0

How can I send an email using an email template that is already saved (id=68) from within the extension I am working on?

1 Answer 1

0
civicrm_api3('MessageTemplate', 'send', array(
  'id' => 68,
  ... other params - see api explorer ...
));
2
  • Unfortunately api3 explorer does not tell which parameters are required. I tried adding Message Template ID and Contact ID and From email and Receipient email but get an error message back "error_message": "Could not interpret return values from function." I then tried removing From email and get this error "code": null, "error_message": "mail() returned failure", "mode": 16, "debug_info": null, "type": "PEAR_Error", "user_info": null, "to_string": "[pear_error: message=\"mail() returned failure\" code=0 mode=callback callback=CRM_Utils_REST::fatal prefix=\"\" info=\"\"]",
    – jsherk
    Aug 5 at 21:39
  • 1
    Although the api3 explorer was giving error, the actual code worked using the four paramters Message Template ID and Contact ID and From email and Receipient email.
    – jsherk
    Aug 5 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.