Jump to content

WildBoiBill

New Members
  • Posts

    5
  • Joined

  • Last visited

WildBoiBill's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. well.... i'm sorry i did this but maybe someone can use this in the future... but i figured that out as well.... when using single quotes ('') you can just add a line when using double quotes ("") you add /n My Fix: wp_mail($theme->get_option('contact_form_email'), sprintf( '[%s] ' . esc_html($_POST['contact_form_subject']), get_bloginfo('name') ), 'Social ID: ' . esc_html($_POST['contact_form_socialid']) . 'added a 'enter button' break in the line here Message:' . esc_html($_POST['contact_form_message']),'From: "'. esc_html($_POST['contact_form_name']) .'" <' . esc_html($_POST['contact_form_email']) . '>');
  2. I got it to display the way i want it in the email but now how do i had a "break" My Fix: wp_mail($theme->get_option('contact_form_email'), sprintf( '[%s] ' . esc_html($_POST['contact_form_subject']), get_bloginfo('name') ), 'Social ID: ' . esc_html($_POST['contact_form_socialid']) . 'Message:' . esc_html($_POST['contact_form_message']),'From: "'. esc_html($_POST['contact_form_name']) .'" <' . esc_html($_POST['contact_form_email']) . '>'); It displays like this: Social ID:"input"Message:"input" how do i get a line break in between them? to get this: Social ID: "input" Message: "input"
  3. I actually figured it out.... i got it to show correctly in the email... now i just want them to display differently My First Edit: wp_mail($theme->get_option('contact_form_email'), sprintf( '[%s] ' . esc_html($_POST['contact_form_subject']), get_bloginfo('name') ), esc_html($_POST['contact_form_message']), esc_html($_POST['contact_form_socialid']),'From: "'. esc_html($_POST['contact_form_name']) .'" <' . esc_html($_POST['contact_form_email']) . '>'); My Fix: wp_mail($theme->get_option('contact_form_email'), sprintf( '[%s] ' . esc_html($_POST['contact_form_subject']), get_bloginfo('name') ), esc_html($_POST['contact_form_message']) . esc_html($_POST['contact_form_socialid']),'From: "'. esc_html($_POST['contact_form_name']) .'" <' . esc_html($_POST['contact_form_email']) . '>'); It's sending all the correct information but it's displaying together in the email, how can i get it like this: How it is now: SOCIAL IDMESSAGE How I want it: Social ID: "the input" Message: "the message" Does that make sense??
  4. I updated the code that i believe to send the email, and the result was not what i wanted to see: Original Code: wp_mail($theme->get_option('contact_form_email'), sprintf( '[%s] ' . esc_html($_POST['contact_form_subject']), get_bloginfo('name') ), esc_html($_POST['contact_form_message']),'From: "'. esc_html($_POST['contact_form_name']) .'" <' . esc_html($_POST['contact_form_email']) . '>'); The results were normal as showed My Edit: wp_mail($theme->get_option('contact_form_email'), sprintf( '[%s] ' . esc_html($_POST['contact_form_subject']), get_bloginfo('name') ), esc_html($_POST['contact_form_message']), esc_html($_POST['contact_form_socialid']),'From: "'. esc_html($_POST['contact_form_name']) .'" <' . esc_html($_POST['contact_form_email']) . '>'); The results where "different": the name of the sender was shown as WordPress and the email was shown as my own, the social id was displayed, but was displayed where the message was and the message is not being displayed.... any help with this part?
  5. I was able to edit this code from my word press theme.. I wanted to add a social club ID to as a text field, i was able to add the text field but i cannot seem to get the information from that field sent with the email I edited this contact form file on my word press to try and include a Social ID field, i was able to add the content to the form but i'm unable to get the information sent in the email, keeps giving me awkward results. help plz. <?php session_start(); /** * Template Name: Contact Form */ global $theme; get_header(); ?> <div id="main"> <?php $theme->hook('main_before'); ?> <div id="content"> <?php $theme->hook('content_before'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); /** * Find the post formatting for the pages in the post-page.php file */ get_template_part('post', 'page'); endwhile; else : get_template_part('post', 'noresults'); endif; ?> <div class="contact-form"> <?php if ($_POST['contact_form_submit'] ) { if(!$_POST['contact_form_name'] || !$_POST['contact_form_email'] || !$_POST['contact_form_subject'] || !$_POST['contact_form_socialid'] || !$_POST['contact_form_question'] || !$_POST['contact_form_message']) { ?><div class="error"><?php _e('Please fill in all required fields!','themater'); ?></div><?php } elseif(!is_email($_POST['contact_form_email'])) { ?><div class="error"><?php _e('Invalid email!','themater'); ?></div><?php } elseif(($_SESSION['contact_form_number_one'] + $_SESSION['contact_form_number_two']) != $_POST['contact_form_question']) { ?><div class="error"><?php _e('You entered the wrong solution..','themater'); ?></div><?php } else { wp_mail($theme->get_option('contact_form_email'), sprintf( '[%s] ' . esc_html($_POST['contact_form_subject']), get_bloginfo('name') ), esc_html($_POST['contact_form_message']),'From: "'. esc_html($_POST['contact_form_name']) .'" <' . esc_html($_POST['contact_form_email']) . '>'); unset($_POST); ?><div class="message"><?php _e('Thanks for contacting Devils First MC.','themater'); ?></div><?php } if ( isset($_SESSION['contact_form_number_one'] ) ) unset( $_SESSION['contact_form_number_one'] ); if ( isset($_SESSION['contact_form_number_two'] ) ) unset( $_SESSION['contact_form_number_two'] ); } if ( !isset($_SESSION['contact_form_number_one'] ) ) $_SESSION['contact_form_number_one'] = $contact_form_number_one = rand(1, 9); else $contact_form_number_one = $_SESSION['contact_form_number_one']; if ( !isset($_SESSION['contact_form_number_two'] ) ) $_SESSION['contact_form_number_two'] = $contact_form_number_two = rand(1, 9); else $contact_form_number_two = $_SESSION['contact_form_number_two']; ?> <form method="post" action=""> <input type="hidden" name="contact_form_submit" value="true" /> <div class="contact-form-label alignleft <?php if($_POST && !$_POST['contact_form_name']) { echo 'contact-form-required'; } ?>"><?php _e('Name','themater'); ?>:</div> <div class="contact-form-input"><input type="text" name="contact_form_name" value="<?php if ( isset($_POST['contact_form_name']) ) { echo esc_attr($_POST['contact_form_name']); } ?>" /></div> <div class="contact-form-label alignleft <?php if($_POST && !$_POST['contact_form_socialid']) { echo 'contact-form-required'; } ?>"><?php _e('Social Club ID','themater'); ?>:</div> <div class="contact-form-input"><input type="text" name="contact_form_socialid" value="<?php if ( isset($_POST['contact_form_socialid']) ) { echo esc_attr($_POST['contact_form_socialid']); } ?>" /></div> <div class="contact-form-label alignleft <?php if($_POST && !$_POST['contact_form_email']) { echo 'contact-form-required'; } ?>"><?php _e('Email','themater'); ?>:</div> <div class="contact-form-input"><input type="text" name="contact_form_email" value="<?php if ( isset($_POST['contact_form_email']) ) { echo esc_attr($_POST['contact_form_email']); } ?>" /></div> <div class="contact-form-label alignleft <?php if($_POST && !$_POST['contact_form_question']) { echo 'contact-form-required'; } ?>"><?php echo $contact_form_number_one; ?> + <?php echo $contact_form_number_two; ?> = ?</div> <div class="contact-form-input"><input type="text" name="contact_form_question" value="" /></div> <div class="contact-form-label alignleft <?php if($_POST && !$_POST['contact_form_subject']) { echo 'contact-form-required'; } ?>"><?php _e('Subject','themater'); ?>:</div> <div class="contact-form-input"><input type="text" name="contact_form_subject" value="<?php if ( isset($_POST['contact_form_subject']) ) { echo esc_attr($_POST['contact_form_subject']); } ?>" /></div> <div class="contact-form-label alignleft <?php if($_POST && !$_POST['contact_form_message']) { echo 'contact-form-required'; } ?>"><?php _e('Message','themater'); ?>:</div> <div class="contact-form-input"><textarea name="contact_form_message" ><?php if ( isset($_POST['contact_form_message']) ) { echo esc_textarea($_POST['contact_form_message']); } ?></textarea></div> <div class="contact-form-label alignleft"> </div> <div class="contact-form-input" style="text-align: center;"><input type="submit" value="<?php _e('Submit','themater'); ?>" /></div> </form> </div> <?php $theme->hook('content_after'); ?> </div><!-- #content --> <?php get_sidebars(); ?> <?php $theme->hook('main_after'); ?> </div><!-- #main --> <?php get_footer(); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.