HELP (adding some text and images)

khenji

New member
May 11, 2022
8
0
1
Code:
    // send the mail
    if( !function_exists('gdlr_hotel_mail') ){
        function gdlr_hotel_mail($recipient, $title, $message, $reply_to = ''){
            global $hotel_option;

            $headers = 'From: ' . $hotel_option['recipient-name'] . ' <' . $hotel_option['recipient-mail'] . '>' . "\r\n";
            if( !empty($reply_to) ){
                $headers = $headers . 'Reply-To: ' . $reply_to . ' <' . $reply_to . '>' . "\r\n";
            }
            $headers = $headers . 'Content-Type: text/plain; charset=UTF-8 ' . " \r\n";
            wp_mail($recipient, $title, $message, $headers);       
        }
    }
    
    if( !function_exists('gdlr_hotel_mail_content') ){
        function gdlr_hotel_mail_content($contact, $data, $payment_info, $price){
            $content  = __("Contact Info", "gdlr-hotel") . " \n";
            $content .= __("Name :", "gdlr-hotel") . " {$contact['first_name']}\n";
            $content .= __("Last Name :", "gdlr-hotel") . " {$contact['last_name']}\n";
            $content .= __("Phone :", "gdlr-hotel") . " {$contact['phone']}\n";
            $content .= __("Email :", "gdlr-hotel") . " {$contact['email']}\n";
            $content .= __("Address :", "gdlr-hotel") . " {$contact['address']}\n";
            $content .= __("Additional Note :", "gdlr-hotel") . " {$contact['additional-note']}\n";
            $content .= __("Coupon :", "gdlr-hotel") . " {$contact['coupon']}\n";
            if( !empty($data['gdlr-hotel-branches']) ){
                $term = get_term_by('id', $data['gdlr-hotel-branches'], 'room_category');
                $content .= "Branches : {$term->name}\n";
                
                $category_meta = get_option('gdlr_hotel_branch', array());
                if( !empty($category_meta[$term->slug]['content']) ){
                    $content .= "Location : {$category_meta[$term->slug]['content']}\n";
                }
            }
            $content .= "\n";


this is the preview : https://snipboard.io/TmAxdy.jpg
i want to change it to: https://snipboard.io/6iHVcX.jpg

thanks in advance
 

kafuuchino

Active member
May 13, 2022
147
68
28
Isekai
To add images and text you only need to copy a few lines of $content, and fill it with the image url and text you want

Ex :

$content = __("Dear Reservation Team", "gdlr-hotel") . " \n\n";

The \n function to add a line is the same as the enter key function
 
  • Like
Reactions: khenji

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu