mailjet-apiv3-java icon indicating copy to clipboard operation
mailjet-apiv3-java copied to clipboard

Only two variables are set in template

Open ergunp opened this issue 7 years ago • 2 comments

Hi I have a template which has multiple variables within the same section and a single variable in another section

section 1

{{var:header_text:""}}

section 2

Change summary : {{var:change_summary:""}}

Justification : {{var:justification:""}}

Impact : {{var:impact:""}}

Impact venue/region : {{var:impact_venue_region:""}}

Roll-back : {{var:roll_back:""}}

Roll-back duration : {{var:roll_back_duration:""}}

Start of maintenance : {{var:start_of_maintenance:""}}

Expected end of maintenance : {{var:end_of_maintenance:""}}

Currently it seems like only the variable in section 1 (header_text) and first variable in section 2 (change_summary) are being set when an email is sent,

here is the json object

{
	"Messages": [{
		"From": {
			"Email": "xxxx",
			"Name": "Sky"
		},
		"Subject": "[[data:name:\"planned\"]]",
		"To": [{
			"Email": "vvvvv"
		}],
		"TemplateID": 1042484,
		"TemplateLanguage": true,
		"Variables": {
			"change_summary": " some change summary\u003c/title\u003e\u003c!--[if",
			"header_text": "started something change text",
			"justification": "none",
			"impact": "some impact",
			"impact_venue_region": "all regions",
			"roll_back": "none",
			"roll_back_duration": "1 hour"
		}
	}],
	"SandboxMode": false,
	"TemplateErrorDeliver": true
}

and here is the response i get

{
	"Messages": [{
		"Status": "success",
		"CustomID": "",
		"To": [{
			"Email": "vvvv",
			"MessageUUID": "2df4aab0-597f-4038-b728-2304dceddc57",
			"MessageID": 288230378077475754,
			"MessageHref": "https://api.mailjet.com/v3/REST/message/288230378077475754"
		}],
		"Cc": [],
		"Bcc": []
	}]
}

ergunp avatar Oct 21 '19 13:10 ergunp

Seems like you can only have 1 variable in a single section :(

ergunp avatar Oct 21 '19 14:10 ergunp

Hi @ergunp, sorry for the long answer!

I additionally verified variables functionality with multiple sections and seems like it works fine. In my case, all variables in all MJML sections were processed successfully.

My guess is that you encountered some transient error on the API side, and right now it's fixed.

Going to close it for now, as not related to the C# SDK. If you still have any errors, please, open a support request for the specific account that has those sections/template, so we could investigate it further.

sdiakovskyi-gd avatar Dec 18 '20 03:12 sdiakovskyi-gd