• Smart Site

    (@polishyourimage)


    Thanks for great plugin!

    I would like to add a custom shortcode into the message body that gets emailed by this plugin. How can I accomplish this?

    For example, I’d like to add [phone_number] into the message body.

    From: [your-name] <[your-email]>
    
    CALL US: [phone_number]
    
    Message Body:
    Phone Number: [text-351]
    Best Time: [menu-215]
    Problem: [menu-795]
    [your-message]
    
    --
    This mail is sent via contact form on [_url] from [_remote_ip]

    https://wordpress.org/plugins/contact-form-7/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Thread Starter Smart Site

    (@polishyourimage)

    Dear Takayuki,

    Thanks for your reply.

    I’m actually referring to Shortcodes and not tags. Isn’t there a difference? I use a [phone_number] shortcode in my theme and content that I’d also like to use in the email body. Is there any way to do that?

    Kind Regards,
    Jase

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Contact Form 7’s mail-tags are different from general WordPress shortcodes. You can’t use WP shortcodes in mail content.

    Thread Starter Smart Site

    (@polishyourimage)

    Thanks for your response.

    Is there some way to insert a variable into the body of the mail without hacking the module? I would be willing to pay a commission/bounty for this feature. What do you think?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    You can utilize the wpcf7_special_mail_tags filter to replace tags in mail to arbitrary values without directly modifying the plugin code.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘add shortcode to message body’ is closed to new replies.