1

I am trying to write an extension that monthly will send a series of CiviMai emails. Basically, it would be the same if a user went to the Sent mailings and clicked Re-Use and sent the email again without any changes to the email at all.

Obviously, I need the email to be sent the first time but after that, I am not sure how I would use the API to duplicate the email and then schedule it to send.

Any help is greatly appreciated. I am using Drupal 7 and CiviCRM 5.11.

Thanks, Josh

1

Look at the bottom lines here to get you started: https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/Controller/Send.php

i.e. $clone = civicrm_api3('Mailing', 'clone', array('id' => $mid)); and then follow thru the rest of the code.

0

We have an extension that does something similar i.e. injects emails into the civimail queue. If your interested drop me a line.

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.