/
sendEmail() Template Throws Error, "Variable >>issue<< is already defined in the same context!"
sendEmail() Template Throws Error, "Variable >>issue<< is already defined in the same context!"
Problem
When referencing the āissueā variable in a template referenced when using sendEmail(), an error is thrown "Variable >>issue<< is already defined in the same context!"
The āissueā variable is a reserved keyword when using sendmail() with a template. Consider the following sendEmail() script that references ātemplate.tplā:
string issue = "DEMO-1";
sendEmail("name@example.com", "subject goes here, "path/to/template.tpl");
Now for template.tpl:
Current issue key: $issue$.
Solution
Consider using a variable besides āissueā. For example, āissueKeyā:
string issueKey = "DEMO-1";
sendEmail("name@example.com", "subject goes here, "path/to/template.tpl");
Now for template.tpl:
Current issue key: $issueKey$.
In this instance, āissueKeyā will not throw an error.
Related articles
Filter by label
There are no items with the selected labels at this time.
, multiple selections available,
Related content
Mail configuration
Mail configuration
Read with this
sendEmail() Template Throws Error, "Variable >>issue<< is already defined in the same context!"
sendEmail() Template Throws Error, "Variable >>issue<< is already defined in the same context!"
More like this
sendEmail
sendEmail
Read with this
sendEmail() Template Throws Error, "Variable >>issue<< is already defined in the same context!"
sendEmail() Template Throws Error, "Variable >>issue<< is already defined in the same context!"
More like this
SIL Template Language
SIL Template Language
Read with this
Email templates
Email templates
More like this