Is there a simple way to send emails from an Azure logic app using SendGrid to multiple recipients, e.g. comma-separated etc?
This is how it looks now:
"actions": {
"Send_email_(V3)": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "#parameters('$connections')['sendgrid']['connectionId']"
}
},
"method": "post",
"body": {
"from": "webserver#hotmail.com",
"to": "firstaddress#somemail.com",
"subject": "** My subject **",
"text": "Some text",
"ishtml": ""
},
"path": "/v3/mail/send"
},
Is it possible to have
"to": "firstaddress#somemail.com, secondaddress#somemail.com"
?
The SendGrid V3 connector documentation states that you can separate the email addresses by comma in the To, CC or BCC fields:
Valid email addresses separated by a semicolon or comma
Checkout the documentation: SendGrid Connector
Related
I am trying to send a simple password reset email that's defined in a dynamic template. I have tested the template within SendGrid and it works fine. I have copied and pasted the template_id from the website, checked and double-checked it, but trying to post this message:
{
"personalizations": [
{
"to": [
{
"email": "chairman###########.org.uk"
}
],
"dynamic_template_data": {
"firstname": "Tim",
"url": "https://localhost:5001/account/ProcessPasswordReset?id=4&code=############"
},
"send_at": 0
}
],
"from": {
"email": "membership###########.org.uk",
"name": "A Person"
},
"reply_to_list": [],
"subject": "Password Reset",
"content": [],
"template_id": "d-23a2c68a9e5349488be23299a04a9485",
"send_at": 0
}
I get the following response
{
"errors": [
{
"message": "Unless a valid template_id is provided, the content parameter is required. There must be at least one defined content block. We typically suggest both text/plain and text/html blocks are included, but only one block is required.",
"field": "content",
"help": "http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.content"
}
]
}
As far as I can tell from the documentation, this is a well-formed message with a correct template_id.
Ok so the problem was the empty
"content": [],
This must not be sent at all if there is no content to send. Working as expected now this is removed.
I am testing the Single Product Message API endpoint in Whatsapp-Business Cloud.
It is working for some of the products in the catalogue, but for some other products in the same catalogue giving error as 'product not found for product_retailer_id, XX, in catalog_id, XXXXXXXXX'
I can't see any Issue / Policy violations for those products.
This is the Sample Request Payload
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "XXXX",
"type": "interactive",
"interactive": {
"type": "product",
"body": {
"text": "Hello 111111"
},
"footer": {
"text": "Hello1 1111111"
},
"action": {
"catalog_id": "XXXX",
"product_retailer_id": "XX"
}
}
}
can you please help me to resolve this issue
I had the same issue. My catalog_id and product_retailer_id is valid, but somehow still do not work. Then I submit a ticket to FB direct support, and after a couple of seconds suddenly it works. I haven't gotten any response from direct support yet. Maybe after registering the catalog and connecting the catalog to a WhatsApp number, we need to wait for some time.
Here is my json payload
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "6289XXX055XXX",
"type": "interactive",
"interactive": {
"type": "product",
"body": {
"text": "Indomie"
},
"footer": {
"text": "Indomie rasa soto"
},
"action": {
"catalog_id": "553992496785XXX",
"product_retailer_id": "indomie-soto"
}
}
}
I'm working on an email connector that is sending emails successfully.
But I want to send emails with an attachment.
I am using email connector 1.0.2 that support the attachments in its payload.
<email.send configKey="EMAIL_CONNECTION_SMTP">
<from>{json-eval($.from)}</from>
<to>{json-eval($.to)}</to>
<subject>{json-eval($.subject)}</subject>
<content>{$ctx:DecodedBodyTemplate}</content>
<contentType>{$ctx:contentType}</contentType>
<attachments>{json-eval($.attachments)}</attachments>
</email.send>
And the payload has:
"attachments": [
{
"name": "sampleimagefile.txt",
"content": "This is a text file"
}
]
I tried using base64encoded string in content too.
Yet I'm still receiving emails without any attachment.
I also use email connector 1.0.2 and I don't have any issue sending attachments.
Look here for more info.
So, your payload should look like this:
{
"from": "user1#gmail.com",
"to": "user2#gmail.com",
"subject": "This is the subject",
"content": "This is the body",
"contentType": "text/plain",
"attachments": [
{
"name": "sampleimagefile.png",
"content": "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
}
]
}
I need to send a payload to multiple recipients in SendGrid. I use the Dynamic Templates to construct the email body, and all is working fine.
I would like to add a 'Hi {{recipientName}}' line to the email but I cannot find any documentation on it, is it possible?
I cannot include the recipient detail in the payload as a single payload goes out to many recipients
Use personalizations.
Personalizations allow you to override these various metadata for each email in an API request.
Your request will look like this:
{
"from": "gilbert#techmail.com",
"template_id": "YOUR TEMPLATE ID",
"personalizations": [
{
"to": [
{
"email": "john#example.com"
}
],
"substitutions": {
"%fname%": "John",
"%CustomerID%": "C001"
},
},
{
"to": [
{
"email": "peter#example.com"
}
],
"substitutions": {
"%fname%": "Peter",
"%CustomerID%": "C005"
},
"send_at": 1629723541
}
]
}
and it will go as a single request.
Also look at this github comment.
I'm trying to send out mails using mandrill. The problem is that when I add multiple recipients to the 'to' parameter, it sends out the same mail multiple times with ALL the recepients in the 'to' list. I was expecting the same mail to be sent out individually to every person in the to list. Am I missing something ?
{
"key": "app-key",
"template_name": "platform-invite",
"template_content": [
{
"name": "connection",
"content": "<a class=\"mcnButton \" title=\"Lets Go\" href=\"http://someurl\" target=\"_blank\" style=\"font-weight: normal;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;\">Lets go</a>"
},
{
"name": "mailbody",
"content": "<p>Hi </p>\n<p>I would like you to be a ... Tic tic tic...</p>"
}
],
"message": {
"subject": "My subject line over herer",
"from_email": "superman#mydomain.co",
"to": [
{
"email": "person1#gmail.com,
"type": "to"
},
{
"email": "person2#gmail.com",
"type": "to"
},
{
"email": "person3#gmail.com",
"type": "to"
},
{
"email": "person4#gmail.com",
"type": "to"
}
],
"merge_vars": {}
},
"async": false,
"ip_pool": "Main Pool"
}
There's an option in your Sending Options to expose recipients to one another. You can uncheck that box to not show everyone's information in the 'to' header. The option(s) you select in the Sending Options are used by default for your account. You can override any of these options in individual API calls. In this case, you could use the preserve_recipients parameter to override the current default that's set for your account.