1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<?php
class wcal_default_template_settings {
function wcal_create_default_templates() {
global $wpdb;
$template_name_array = 'Initial';
$site_title = get_bloginfo( 'name' );
$site_url = get_option( 'siteurl' );
$template_subject_array = $site_title . ": Did you have checkout trouble?";
$active_post_array = 0;
$email_frequency_array = 1;
$day_or_hour_array = 'Hours';
$body_content_array = addslashes( "<html>
<body>
<p> Hello {{customer.fullname}}, </p>
<p> </p>
<p> We\'re following up with you, because we noticed that on {{cart.abandoned_date}} you attempted to purchase the following products on $site_title. </p>
<p> </p>
<p> {{products.cart}} </p>
<p> </p>
<p> If you had any purchase troubles, could you please Contact to share them? </p>
<p> </p>
<p> Otherwise, how about giving us another chance? Shop <a href= $site_url >$site_title</a>. </p>
<hr></hr>
<p> You may <a href='{{cart.unsubscribe}}'>unsubscribe</a> to stop receiving these emails. </p>
<p> </p>
<p> <a href=$site_url>$site_title</a> appreciates your business. </p>
</body>
</html>" );
$is_wc_template = 1 ;
$default_template = 1;
$query = "INSERT INTO `" . $wpdb->prefix . "ac_email_templates_lite`
( subject, body, is_active, frequency, day_or_hour, template_name, is_wc_template, default_template )
VALUES ( '" . $template_subject_array . "',
'" . $body_content_array . "',
'" . $active_post_array . "',
'" . $email_frequency_array . "',
'" . $day_or_hour_array . "',
'" . $template_name_array . "',
'" . $is_wc_template . "',
'" . $default_template . "' )";
$wpdb->query( $query );
}
}