sendgrid / sendgrid-csharp

The Official Twilio SendGrid C#, .NetStandard, .NetCore API Library
https://sendgrid.com
MIT License
1.07k stars 588 forks source link

Using templates in Azure Logic Apps #1088

Open freemstr opened 3 years ago

freemstr commented 3 years ago

Are there any plans to add an option to use templates with Azure Logic Apps? .NET API takes template ID and object for paramters Same would be great from Azure Logic Apps Thank you.

eshanholtz commented 3 years ago

No, we do not currently have any plans to add templates as an option. Can you please expand on what we'd need to do to support this use case?

Thanks

freemstr commented 3 years ago

@eshanholtz

in .NET projects we are able to supply template ID and data (which is effectively JSON) which results in formatted email being sent

For example:

            msg.SetTemplateId(templateguid);
            msg.SetTemplateData(new { 
                body = mailbody, 
                subject = subject, 
                preheader = preheader 
            });

            var code = client.SendEmailAsync(msg)

Same would be great to have in Azure After all, templating is what differentiates SendGrid from using SMTP

From the UX perspective it would likely be an additional optional parameter on the connector for the Template Id

Thank you for looking into it

freemstr commented 3 years ago

If anyone is looking to do this in logic apps image but building the body json could be easier done with a dedicated action

I was not able to find other SendGrid logic apps resources on GitHub so I am posting it here as an idea and a workaround solution.