You are here

protected function AddMailchimpEventWebformHandler::getEmailToken in Mailchimp 2.x

Finds the token for the email to send.

Return value

string The token.

1 call to AddMailchimpEventWebformHandler::getEmailToken()
AddMailchimpEventWebformHandler::submitConfigurationForm in modules/mailchimp_events/src/Plugin/WebformHandler/AddMailchimpEventWebformHandler.php
Form submission handler.

File

modules/mailchimp_events/src/Plugin/WebformHandler/AddMailchimpEventWebformHandler.php, line 266

Class

AddMailchimpEventWebformHandler
Webform submission Event handler.

Namespace

Drupal\mailchimp_events\Plugin\WebformHandler

Code

protected function getEmailToken($values) {
  $type = $values['email_type'];
  $email = FALSE;
  switch ($type) {
    case 'user':
      $email = '[current-user:mail]';
      break;
    case 'form_email':
      $email = $values['events']['form_email'];
      break;
    case 'single':
      $email = $values['events']['single'];
      break;
    case 'token':
      $email = $values['events']['token'];
      break;
  }
  return $email;
}