API DOCUMENTATION Last Update: Apr 2022

Email Templates - List

Returns the list of the existing email templates for a given account.

The data to be submitted to the API is composed of the following fields:

 

  field   Example   Note
API 1.5 Required
user_id john1970 Required
user_api_key 1959ca5645adac9b13dcb3 Required
account_id greatwidgets Required
type manage_email_templates Required
action list Required
include_content Y Optional
Output Format:
output JSON or XML Optional. If not provided, defaults to XML
callback someFunctionName Optional: JSONP format
condensed yes Optional (No white space)
Applies only to JSON(P) output

 

 

Example PHP Request:

If you are using PHP, the $data array would look like this:

  1. $data['user_id'] = 'john1970';
  2. $data['user_password'] = '1959caadac9b13dcb3';
  3. $data['type'] = 'manage_email_templates';
  4. $data['action'] = 'info';
  5. $data['account_id'] = 'greatwidgets';

 

Success XML Response

  1. <response status="success">
  2. <email_template>
  3. <account_id>greatwidgets</account_id>
  4. <template_id>7</template_id>
  5. <template_name>New Customers Email</template_name>
  6. <template_description>New Customers Email</template_description>
  7. <template_rule>NEW_CUSTOMER</template_rulen>
  8. <campaign_id>1111222233334444</campaign_id>
  9. <campaign_name>Widget Rewards</campaign_name>
  10. <template_subject>Welcome to Amazing Rewards</template_subject>
  11. <template_content>Email content goes here</template_content>
  12. <include_balance>Y</include_balance>
  13. <include_rewards>Y</include_rewards>
  14. </email_template>
  15. <email_template>
  16. <account_id>greatwidgets</account_id>
  17. <template_id>8</template_id>
  18. <template_name>Redemption Email</template_name>
  19. <template_description>Email for Redemptions </template_description>
  20. <template_rule>DEDUCTION_TRANS</template_rulen>
  21. <campaign_id>1111222233334444</campaign_id>
  22. <campaign_name>Widget Rewards</campaign_name>
  23. <template_subject>Enjoy your reward</template_subject>
  24. <template_content>Email content goes here</template_content>
  25. <include_balance>Y</include_balance>
  26. <include_rewards>Y</include_rewards>
  27. </email_template>
  28. <email_template>
  29. <account_id>greatwidgets</account_id>
  30. <template_id>9</template_id>
  31. <template_name>Positive Transactions Email </template_name>
  32. <template_description>Email for Positive Transactions</template_description>
  33. <template_rule>POSITIVE_TRANS</template_rulen>
  34. <campaign_id>1111222233334444</campaign_id>
  35. <campaign_name>Widget Rewards</campaign_name>
  36. <template_subject>You have earned more points!</template_subject>
  37. <template_content>Email content goes here

    </template_content>
  38. <include_balance>Y</include_balance>
  39. <include_rewards>Y</include_rewards>
  40. </email_template>
  41. </response>

Error XML Response:

  1. <response status="error">
  2. <error>Error message</error>
  3. </response>