• Resolved ricky4001

    (@ricky4001)


    Hi, I’ve managed to include the ad title in the email subject but want to include a ‘reference code’ (custom field) in the email subject also, how would I achieve this? My custom field is simply named ‘code’.

    $mail[“subject”] = $post->post_title . ” – ” . $mail[“subject”];

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,you should be able to do this with following code

    
    $mail["subject"] = $post->post_title . " – " . $mail["subject"] . " - " . adverts_request("reference_code");
    

    or

    
    $mail["subject"] = $post->post_title . " – " . $mail["subject"] . " - " . $form->get_value("reference_code");
    

    assuming your custom field name is “reference_code”.

    Thread Starter ricky4001

    (@ricky4001)

    For whatever reason I couldn’t get either of those to work, but this below works perfectly:

    $mail[“subject”] = $post->reference_code . ” – ” . $post->post_title . ” – ” . $mail[“subject”];

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Include custom field in email subject’ is closed to new replies.