We had a requirement to send email to multiple recipients, with our image branding embedded in signature.
In this Logic App implementation I have used SendGrid to send email.
Below are the steps at high level.
In this Logic App implementation I have used SendGrid to send email.
Below are the steps at high level.
- Get the Image from Blob location.
- Encode the output to Base64
- Add the tag to the encoded output
ARM Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$connections": { | |
"value": { | |
"azureblob": { | |
"connectionId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-aue-poc-test/providers/Microsoft.Web/connections/azureblob", | |
"connectionName": "azureblob", | |
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Web/locations/australiaeast/managedApis/azureblob" | |
}, | |
"sendgrid": { | |
"connectionId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-aue-poc-test/providers/Microsoft.Web/connections/sendgrid", | |
"connectionName": "sendgrid", | |
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Web/locations/australiaeast/managedApis/sendgrid" | |
} | |
} | |
}, | |
"definition": { | |
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", | |
"actions": { | |
"Get_blob_content_using_path": { | |
"inputs": { | |
"host": { | |
"connection": { | |
"name": "@parameters('$connections')['azureblob']['connectionId']" | |
} | |
}, | |
"method": "get", | |
"path": "/datasets/default/GetFileContentByPath", | |
"queries": { | |
"inferContentType": true, | |
"path": "/container/image.JPG", | |
"queryParametersSingleEncoded": true | |
} | |
}, | |
"runAfter": { | |
"Initialize_variable_2": [ | |
"Succeeded" | |
] | |
}, | |
"type": "ApiConnection" | |
}, | |
"Initialize_variable": { | |
"inputs": { | |
"variables": [ | |
{ | |
"name": "subject", | |
"type": "String", | |
"value": "this is subject" | |
} | |
] | |
}, | |
"runAfter": {}, | |
"type": "InitializeVariable" | |
}, | |
"Initialize_variable_2": { | |
"inputs": { | |
"variables": [ | |
{ | |
"name": "body", | |
"type": "String", | |
"value": "12345" | |
} | |
] | |
}, | |
"runAfter": { | |
"Initialize_variable": [ | |
"Succeeded" | |
] | |
}, | |
"type": "InitializeVariable" | |
}, | |
"Send_email_(V2)": { | |
"inputs": { | |
"body": { | |
"from": "mozaid@zaidcloud.com", | |
"ishtml": true, | |
"subject": "@variables('subject')", | |
"text": "This is test email <br>\n<img src=\"data:image/jpeg;base64,@{base64(body('Get_blob_content_using_path'))}\">", | |
"to": "mozaid@zaidcloud.com" | |
}, | |
"host": { | |
"connection": { | |
"name": "@parameters('$connections')['sendgrid']['connectionId']" | |
} | |
}, | |
"method": "post", | |
"path": "/mail/send" | |
}, | |
"runAfter": { | |
"Get_blob_content_using_path": [ | |
"Succeeded" | |
] | |
}, | |
"type": "ApiConnection" | |
} | |
}, | |
"contentVersion": "1.0.0.0", | |
"outputs": {}, | |
"parameters": { | |
"$connections": { | |
"defaultValue": {}, | |
"type": "Object" | |
} | |
}, | |
"triggers": { | |
"Recurrence": { | |
"recurrence": { | |
"frequency": "Minute", | |
"interval": 3 | |
}, | |
"type": "Recurrence" | |
} | |
} | |
} | |
} |
I just want to let you know that I just check out your site and I find it very interesting and informative.. email lookup
ReplyDeleteI think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. testosterone australia
ReplyDelete