function registration_broadcast_preview in Entity Registration 8
Same name and namespace in other branches
- 8.2 includes/registration.forms.inc \registration_broadcast_preview()
- 7.2 includes/registration.forms.inc \registration_broadcast_preview()
- 7 includes/registration.forms.inc \registration_broadcast_preview()
1 string reference to 'registration_broadcast_preview'
- registration_registrations_broadcast_form in includes/registration.forms.inc 
- Return a form for sending a broadcast email to participants.
File
- includes/registration.forms.inc, line 429 
- Form definitions and callbacks for Registration.
Code
function registration_broadcast_preview($form, &$form_state) {
  $entity_type = $form_state['entity']['entity_type'];
  $entity_id = $form_state['entity']['entity_id'];
  $message_template = $form_state['values']['message'];
  $entity = entity_load_single($entity_type, $entity_id);
  if (\Drupal::moduleHandler()
    ->moduleExists('token')) {
    $message = token_replace($message_template, array(
      $entity_type => $entity,
    ));
  }
  $form_state['registration_broadcast_preview'] = $message;
  $form_state['rebuild'] = TRUE;
}