Azure / Azure/azure-functions-java-library

@SendGridOutput ignores personalizations->dynamic_template_data

Abierto
#146 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:java-functions
Lenguaje dominante
Java
Estrellas
45
Forks
49
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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:**
```

Hello {{ firstName }}.




We've received new call back request {{ callbackId }} at {{ callbackTimestamp }}.


Please follow up with the new enrollee {{ enrolleeFirstName }} {{ enrolleeLastName }} at {{ enrolleePhone }} .




Yours truly, subscription bot.


```

**The value we put into the output value (OutputBinding outSendgridMessage):**
```
{
"personalizations":
[
{
"to": [{"email":"my@email.com"}],
"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](https://user-images.githubusercontent.com/1226001/110957171-6afb0e00-835c-11eb-861a-d4843499a1d8.png)

Please investigate why it is happening.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

No se nombra ningún archivo ni prueba. Empieza siguiendo el binding Java @SendGridOutput con el JSON de personalizations y dynamic_template_data proporcionado, y después compara la solicitud de SendGrid generada con el formato documentado. Se considera terminado cuando la plantilla dinámica recibe los valores de personalización y los renderiza en el correo electrónico.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
azure, java
Área
backend, cloud
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.