sendgrid-action icon indicating copy to clipboard operation
sendgrid-action copied to clipboard

How can i pass dynamic value as part of the email body

Open mihir-mehta opened this issue 4 years ago • 2 comments

This Works well as long as body of the email is static. But what if i want to add something dynamically in the mail body ?

Basically this is what i want to do through github actions

1> Execute test cases through CI/CD pipelines 2> Upload coverage report to bucket on cloud (Initally wanted to send that as an attachment but gmail blocks attachment with .js extension) 3> Send email with the link of the uploaded report through sendgrid actions

I am able to achieve all 3 except i am not able to dynamically change the body of the email based on the output of other actions

Thank you

mihir-mehta avatar Nov 23 '21 11:11 mihir-mehta

Hi @mihir-mehta

I'm not sure what is best here, but one idea would be to pass dynamic parts of the message body to the script as environment variables. Then read the environment variable in the script and use it in the message body.

peter-evans avatar Nov 24 '21 01:11 peter-evans

Thank you Peter, Not sure exactly how to do that , will try it out... Thanks

mihir-mehta avatar Nov 24 '21 05:11 mihir-mehta