function pet_make_preview in Previewable email templates 6
Same name and namespace in other branches
- 7 includes/pet.admin.inc \pet_make_preview()
Generate a preview of the tokenized email for the first in the list.
1 call to pet_make_preview()
- pet_user_form_submit in ./
pet.admin.inc - Form submission. Take action on step 2 (confirmation of the populated templates).
File
- ./
pet.admin.inc, line 501 - Contains administrative pages for creating, editing, and deleting previewable email templates (PETs).
Code
function pet_make_preview(&$form_state) {
$params = array(
'pet_uid' => $form_state['storage']['recipients'][0]['uid'],
'pet_nid' => $form_state['storage']['nid'],
);
$subs = pet_substitutions($form_state['storage']['pet'], $params);
$form_state['storage']['subject_preview'] = token_replace_multiple($form_state['values']['subject'], $subs);
$form_state['storage']['body_preview'] = token_replace_multiple($form_state['values']['mail_body'], $subs);
}