Appnitro Software Forums » MachForm

Custom body copy for email notification

(3 posts)

  1. xlawdog
    Member

    Is there any way to add a sentence or two of body copy above the list of form labels / values in the notification email?

    This would have to be customized and different for each form.

    Posted 4 years ago #
  2. The easiest way to do this would be editing your includes/helper-functions.php.

    On line 412, you will find this block of code:

    $email_body = '';
    $i=1;
    foreach ($email_data as $data){
    	$email_body .= "{$i}) <b>{$data['label']}</b> {$data['value']} ";
    	$i++;
    }


    As you can see, the $email_body is initialized with an empty string. All we need to do is to initialize that variable with your own custom text for each form.

    The code should be something like this:

    if($form_id == 1){
    	$email_body = 'Hello this is form 1';
    }elseif($form_id == 2){
    	$email_body = 'Hello this is form 2';
    }else{
    	$email_body = '';
    }
    $i=1;
    foreach ($email_data as $data){
    	$email_body .= "{$i}) <b>{$data['label']}</b> {$data['value']} ";
    	$i++;
    }


    Simply adjust the text for each form_id and you should be all set.

    Posted 4 years ago #
  3. xlawdog
    Member

    Beautiful! Thank you.

    Posted 4 years ago #

RSS feed for this topic

Reply

You must log in to post.