I want to use the Drupal modules Webform and Email Marketing Framework to allow anonymous users to fill out a short contact form and then be subscribed via the campaignmonitor API to a list.
So far my process idea is as follows, and I'm interested to see if anyone can think of a more streamlined approach?
- Webform submission interrupted using hook_form_alter()
- Form data extracted (Name, email address)
- actions_do() called to fire action with an AID of 2. Action AID2 is instance of emf_subscribe_action()
- Pass form data as appropriate and let EMF do the work communicating with campaign monitor.
As I see it this approach allows me to set up a system which can be administrated all on-site without the need for PHP development. I'm reckoning on setting a certain content type, enabling webforms on it, and then each time a user creates one of these webforms, the action can be called.