Hello, we’re using Courier to automate sending emails. We have some email templates we send through AWS-SES, and now we want to move some of them to a Gmail channel so that the recipient can reply to them. However, sending the same data to the Gmail channel seems not to actually create an email. We have sent emails successfully to the Gmail channel specifying the content directly instead of providing a template id, but we want to use the template id. Is this supported?
Hey @nathaniel.saxe - Passing data through variables should be supported through the Gmail channel. Is the email client not rendering the email you want to display with its corresponding data? Is your most recently updated template published?
The email is not appearing at all, either in the recipient’s inbox or Courier studio. The courier client is not throwing an error. I started with a working API input that does send to gmail, then removed the content
key and added in a valid template id under template
and the variables under data
in the same way that works when using AWS SES. I can send the exact JSON of both if you want
That would be helpful. And what is the workspace name that you’re working from?
This sends on AWS-SES (the default channel)
{
"message": {
"to": {
"email": "nathaniel.saxe@runpod.io"
},
"template": "D8WT5V3DEZM1W2QM6ZNHY8A3SDP3",
"data": {
"firstName": "there"
},
"channels": {
"email": {
"override": {}
}
}
}
}
This sends on Gmail:
{
"message": {
"to": {
"email": "nathaniel.saxe@runpod.io"
},
"channels": {
"email": {
"providers": [
"gmail"
]
}
},
"metadata": {
"tags": []
},
"routing": {
"method": "all",
"channels": [
"email",
{
"method": "single",
"channels": []
}
]
},
"content": {
"version": "2022-01-01",
"elements": [
{
"type": "text",
"align": "left",
"content": "test"
},
{
"type": "meta",
"title": "test"
}
]
}
}
}
This does NOT send on gmail, and we would like it to:
{
"message": {
"to": {
"email": "nathaniel.saxe@runpod.io"
},
"template": "D8WT5V3DEZM1W2QM6ZNHY8A3SDP3",
"data": {
"firstName": "there"
},
"channels": {
"email": {
"providers": [
"gmail"
]
}
},
"metadata": {
"tags": []
},
"routing": {
"method": "all",
"channels": [
"email",
{
"method": "single",
"channels": []
}
]
}
}
}
workspace is runpod.io
edit: sorry, that’s our domain. Apparently the workspace is called “Support’s workspace”
What you want to make sure in your email template - D8WT5V3DEZM1W2QM6ZNHY8A3SDP3 is that your email channel is changed to use Gmail. RIght now it’s configured as AWS SES. You can change the provider the channel will use in the channel settings. Change the provider to gmail, publish, and try the request again.
Ok thanks, checking that this works. Do you have a rationale for why templates are scoped to a particular list of channels in this way?
No prob. It’s really up to the user how they scope the template delivery channels. You can have multiple channels for one notification. For example, you could have an AWS SES and a Gmail channel for the same notification template and have enable/disable conditions on each channel so that it’s only enabled if specific data or profile information meets the filtering rules when you pass a request.
Alright, thank you! It worked! I really don’t have any problem with scoping templates this way, but I would suggest throwing an error in the client or having an error response from the API when an email is not sent for this reason.