Emma Block - Enhancements

Component ID

2099077

Component name

Emma Block - Enhancements

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Not intending to fork d.o emma_block, but interested in enhancing and contributing back. Let's merge some time!

As of right now, this sandbox project

  • Refactors a bit of the original code a little wherever I trod
  • Now paves the way for adding in arbitrary "member field" definitions in your subscription form

Use:

To add a zipcode field, for instance:

  1. Add the zipcode field in your http://www.myemma.com instance
  2. Add a new FAPI field to capture zip as shown below
function emma_block_settings_submit($form, $form_state) {
  ...
  // Add this. 'postal_code' is your field's shortname at myemma
  $form['member_fields']['postal_code'] = array(
    '#title' => t('Zip Code'),
    '#type' => 'textfield',
    '#size' => '20',
    '#maxlength' => 128,
    '#required' => TRUE,
  );
  ...
}

See info about your fields

Custom "Member Fields" possible with hardcoded tweaks to the subscription form
build function emma_block_subscribe_form(). To figure out the fields'
machine names, visit
https://PUBAPIKEY:PRIVAPIKEY@api.e2ma.net/ACCOUNT_ID/fields
to see a list.