Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@SendGridOutput ignores personalizations->dynamic_template_data #146

Open
vgarmash opened this issue Mar 12, 2021 · 0 comments
Open

@SendGridOutput ignores personalizations->dynamic_template_data #146

vgarmash opened this issue Mar 12, 2021 · 0 comments

Comments

@vgarmash
Copy link

Hello.

We are trying to use SendGridOutput to send outbound emails from our functions. For each email we need to use dynamic template with handlebars. Learn more on these here:

  1. https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/
  2. https://sendgrid.com/docs/for-developers/sending-email/using-handlebars/

We've created several dynamic templates and for all of them we see similar issue: the dynamic_template_data is not being applied to the template so all placeholders are empty.

Here is the real example:

Template code:

<p>Hello {{ firstName }}.</p>
<br>
<p>We've received new call back request {{ callbackId }} at {{ callbackTimestamp }}.</p>
<p>Please follow up with the new enrollee {{ enrolleeFirstName }} {{ enrolleeLastName }} at <a href="tel:{{ enrolleePhone }}">{{ enrolleePhone }}</a> .</p>
<br>
<p>Yours truly, subscription bot.</p>

The value we put into the output value (OutputBinding outSendgridMessage):

{
  "personalizations":
     [
       {
        "to": [{"email":"[email protected]"}],
        "dynamic_template_data: {
            "firstName":"Coach",
            "enrolleePhone":"7879090099",
            "callbackId":null,
            "enrolleeFirstName":"Joe",
            "enrolleeLastName":"Test105",
            "callbackTimestamp":1615493135111
          }
       }
    ],
  "content":[{"type":"text/html","value":"The new call back request has been received."}],
  "template_id":"d-7a92d5731fc942bb87dd4bfc2ac02afd"
}

The email comes without data:
image

Please investigate why it is happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant