When I add dynamic content functions into my email body, as per the diagram, they fail to appear. Can some bright person please tell me why?
Also, how do I fix this issue? Im not an html dev.
Can this be remediated via simple drag and drop or this a bug in the logic app which requires it be written in?
Any help would be great.
Ive been dragging variables and parse json functions to no avail.
Im not a developer so if something is broken here, I would really appreciate some pointers please?
i suspect there is some sort of disparty between the parse json output and the send an email v2 output being generated:
parse json output:
{
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['office365']['connectionId']"
}
},
"method": "post",
"body": {
"To": "allen.visser@gmail.com",
"Subject": "POSITIVE: REG APP EXP @{variables('displayName')} ",
"Body": "<p>appid : @{body('Parse_JSON')?['properties']?['value']?['type']?['type']?['type']?['items']?['type']?['properties']?['appId']}<br>\n<br>\n<br>\nappid : @{body('Parse_JSON')?['d']?['properties']?['value']?['items']?['properties']?['appId']}<br>\n</p>",
"Importance": "Normal"
},
"path": "/v2/Mail",
"authentication": "@parameters('$authentication')"
}
}
and the parse json body:
{
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['office365']['connectionId']"
}
},
"method": "post",
"body": {
"To": "allen.visser@vaxowave.com",
"Subject": "POSITIVE: REG APP EXP @{variables('displayName')} ",
"Body": "<p>appid : @{body('Parse_JSON')?['properties']?['value']?['type']?['type']?['type']?['items']?['type']?['properties']?['appId']}<br>\n<br>\n<br>\nappid : @{body('Parse_JSON')?['d']?['properties']?['value']?['items']?['properties']?['appId']}<br>\n</p>",
"Importance": "Normal"
},
"path": "/v2/Mail",
"authentication": "@parameters('$authentication')"
}
}
***********************
{
"properties": {
"properties": {
"properties": {
"@@@odata.context": {
"properties": {
"type": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"@@@odata.nextLink": {
"properties": {
"type": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"value": {
"properties": {
"items": {
"properties": {
"properties": {
"properties": {
"appId": {
"properties": {
"type": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"displayName": {
"properties": {
"type": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"id": {
"properties": {
"type": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"passwordCredentials": {
"properties": {
"items": {
"properties": {
"properties": {
"properties": {
"customKeyIdentifier": {
"properties": {
"type": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"displayName": {
"properties": {},
"type": "object"
},
"endDateTime": {
"properties": {
"type": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"hint": {
"properties": {},
"type": "object"
},
"keyId": {
"properties": {
"type": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"secretText": {
"properties": {},
"type": "object"
},
"startDateTime": {
"properties": {
"type": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
},
"required": {
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"type": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"required": {
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"type": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"type": {
"type": "string"
}
},
"type": "object"
}
When I add dynamic content functions into my email body, as per the diagram, they fail to appear.
You can get the values from dynamic content in email body like below-
Code-
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Data": {
"inputs": {
"variables": [
{
"name": "Data",
"type": "string",
"value": "{\n\"FirstName\": \"Ikhtesam\",\n\"LastName\": \"Afrin\"\n}"
}
]
},
"runAfter": {
"Display_Name": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Display_Name": {
"inputs": {
"variables": [
{
"name": "DisplayName",
"type": "string",
"value": "TestSecret"
}
]
},
"runAfter": { },
"type": "InitializeVariable"
},
"Parse_JSON": {
"inputs": {
"content": "@variables('Data')",
"schema": {
"properties": {
"FirstName": {
"type": "string"
},
"LastName": {
"type": "string"
}
},
"type": "object"
}
},
"runAfter": {
"Data": [
"Succeeded"
]
},
"type": "ParseJson"
},
"Send_an_email_(V2)": {
"inputs": {
"body": {
"Body": "<p><strong>This is a onfirmation email-</strong><br>\n<br>\nVariables display name: @{variables('DisplayName')}<br>\n<br>\nFirstName is: @{body('Parse_JSON')?['FirstName']}<br>\n<br>\nLastName is: @{body('Parse_JSON')?['LastName']}</p>",
"Importance": "Normal",
"Subject": "POSITIVE Secret expired @{variables('DisplayName')}",
"To": "*****@xyz.com"
},
"host": {
"connection": {
"name": "@parameters('$connections')['office365']['connectionId']"
}
},
"method": "post",
"path": "/v2/Mail"
},
"runAfter": {
"Parse_JSON": [
"Succeeded"
]
},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": { },
"parameters": {
"$connections": {
"defaultValue": { },
"type": "Object"
}
},
"triggers": {
"manual": {
"inputs": {
"schema": { }
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {
"$connections": {
"value": {
"office365": {
"connectionId": "/subscriptions/**************/resourceGroups/*********/providers/Microsoft.Web/connections/office365",
"connectionName": "office365",
"id": "/subscriptions/***********/providers/Microsoft.Web/locations/eastus/managedApis/office365"
}
}
}
}
}
I am getting the email with all the values in it.
You can format the email body as per your requirement.