• I would like the confirmation email I (the admin) receive to be in all caps. I’m trying to do that with this code:

    ‘add_action( ‘wpcf7_before_send_mail’, ‘wpcf7_all_caps_email’, 10, 3 );

    function wpcf7_all_caps_email( $WPCF7_ContactForm, $abort, $submission ) {
    $mail = $WPCF7_ContactForm->prop( ‘mail’ );
    $mail[‘body’] = strtoupper( $mail[‘body’] );

    // Save the email body.
    $WPCF7_ContactForm->set_properties(
    array(
    ‘mail’ => $mail,
    )
    );
    }`

    But the email that is being sent doesn’t have the values the user enters. It looks like this:

    FROM:
    [YOUR-NAME]
    
    EMAIL:
    [YOUR-EMAIL]
    
    PHONE:
    [YOUR-PHONE]
    
    COMPANY: (EMPTY IF NOT ENTERED)
    [COMPANY-NAME]
    
    EVENT DATE:
    [_FORMAT_EVENT-DATE "F JS Y"]
    
    EVENT LOCATION INFORMATION:
    [EVENT-ADDRESS]
    [EVENT-CITY]
    
    VENUE:
    [VENUE-NAME]
    
    NUMBER OF GUESTS:
    [NUMBER-OF-GUESTS]
    
    DELIVERY REQUESTED?
    [DELIVERY]
    
    MESSAGE:
    [YOUR-MESSAGE]
    
    REQUESTED ITEMS:
    
    [YITH-REQUEST-A-QUOTE-LIST]

    How do I do this? I searched for hours but I’m stuck.

  • The topic ‘How to make email body all caps?’ is closed to new replies.