Adding
-
Hi Aurovrata
I’ve created a page where someone chooses a hotel, adds guests and their preferences, however for some reason I can’t get the email to include the room type (single, double, twin). I’ve tried it as a dropdown, checkbox, and radio button option.
______________________The mail message returns the following:
Guests:
Guest Name Room Type Arrival Date Checkout Date
Benny 2022-03-16 2022-03-19
Blu 2022-03-17 2022-03-20`
______________________Mail message contains this code:
Guests: [cf7sg-form-badminton-3]
______________________The functions.php contains:
add_filter( 'cf7sg_mailtag_cf7sg-form-badminton-3', 'filter_cf7_mailtag_cf7sg_form_badminton_3', 10, 3); function filter_cf7_mailtag_cf7sg_form_badminton_3($tag_replace, $submitted, $cf7_key){ /*the $tag_replace string to change*/ /*the $submitted an array containing all submitted fields*/ /*the $cf7_key is a unique string key to identify your form, which you can find in your form table in the dashboard.*/ if('badminton-3'==$cf7_key ){ $style = 'style="padding:0 3px;border-collapse:collapse;border-bottom:1px solid black[qtm]'; $tag_replace =' <table> <thead><tr><th>Guest Name</th><th>Room Type</th><th>Arrival Date</th><th>Checkout Date</th></tr></thead> <tbody>'; if(!empty($submitted['guest-names'])){ $style = 'style=[qtm]background-color:#e3e3e3[qtm]'; $row=1; foreach($submitted['guest-names'] as $idx=>$guest){ $tag_replace .=' <tr><td '.($row%2==0?$style:'').'>'.$guest.'</td><td '.($row%2==0?$style:'').'>'.$array ['room-type'][$idx]. '</td><td '.($row%2==0?$style:'').'>'.$submitted['arrival-date'][$idx]. '</td><td '.($row%2==0?$style:'').'>'.$submitted['checkout-date'][$idx]. '</td></tr>'.PHP_EOL; $row++; } } $tag_replace .=' </tbody> </table> '; } return $tag_replace; }
______________________
On another topic is there a way to add taking payments for their choice?
Thanks for any assistance you may be able to point me at.
Nick ??
The page I need help with: [log in to see the link]
- The topic ‘Adding’ is closed to new replies.