ddd
Showing
1 changed file
with
12 additions
and
5 deletions
| ... | @@ -20,7 +20,7 @@ add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3); | ... | @@ -20,7 +20,7 @@ add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3); |
| 20 | 20 | ||
| 21 | $email = $submitted_data['your-email']; | 21 | $email = $submitted_data['your-email']; |
| 22 | $subject = 'WYN Important Registration Information'; | 22 | $subject = 'WYN Important Registration Information'; |
| 23 | $message = file_get_contents('https://fp-canada.gotenzing.com/wp-content/themes/understrap-child/inc/Registration-Confirmation.html'); | 23 | $message = file_get_contents(get_site_url().'/wp-content/themes/understrap-child/inc/Registration-Confirmation.html'); |
| 24 | 24 | ||
| 25 | $headers_customer = array('Content-Type: text/html; charset=UTF-8'); | 25 | $headers_customer = array('Content-Type: text/html; charset=UTF-8'); |
| 26 | wp_mail( $email , $subject, $message, $headers_customer); | 26 | wp_mail( $email , $subject, $message, $headers_customer); |
| ... | @@ -32,15 +32,19 @@ add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3); | ... | @@ -32,15 +32,19 @@ add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3); |
| 32 | 32 | ||
| 33 | add_action('publish_wpsl_stores','send_notification_for_publish_project',10,1); | 33 | add_action('publish_wpsl_stores','send_notification_for_publish_project',10,1); |
| 34 | 34 | ||
| 35 | function send_notification_for_publish_project( $post_id ) { | 35 | function send_notification_for_publish_project( $post_id ) { |
| 36 | $notification_sent = get_post_meta($post_id, 'notification_sent_for_publish_project', true); | ||
| 37 | if(!$notification_sent){ | ||
| 38 | update_post_meta($post_id, 'notification_sent_for_publish_project', true); | ||
| 36 | update_post_meta($post_id, 'wpsl_country', 'CA'); | 39 | update_post_meta($post_id, 'wpsl_country', 'CA'); |
| 37 | delete_autoload_map_transient(); | 40 | delete_autoload_map_transient(); |
| 38 | $email = get_post_meta($post_id, 'wpsl_email', true); | 41 | $email = get_post_meta($post_id, 'wpsl_email', true); |
| 39 | $subject = 'WYN Registration Aproved'; | 42 | $subject = 'WYN Registration Aproved'; |
| 40 | $message = file_get_contents('https://fp-canada.gotenzing.com/wp-content/themes/understrap-child/inc/Registration-Acceptance.html'); | 43 | $message = file_get_contents(get_site_url().'/wp-content/themes/understrap-child/inc/Registration-Acceptance.html'); |
| 41 | 44 | ||
| 42 | $headers_customer = array('Content-Type: text/html; charset=UTF-8'); | 45 | $headers_customer = array('Content-Type: text/html; charset=UTF-8'); |
| 43 | wp_mail( $email , $subject, $message, $headers_customer); | 46 | wp_mail( $email , $subject, $message, $headers_customer); |
| 47 | } | ||
| 44 | 48 | ||
| 45 | } | 49 | } |
| 46 | 50 | ||
| ... | @@ -48,11 +52,14 @@ add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3); | ... | @@ -48,11 +52,14 @@ add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3); |
| 48 | add_action( 'trash_wpsl_stores', 'send_notification_for_delete_project' ,10,1); | 52 | add_action( 'trash_wpsl_stores', 'send_notification_for_delete_project' ,10,1); |
| 49 | 53 | ||
| 50 | function send_notification_for_delete_project( $post_id ) { | 54 | function send_notification_for_delete_project( $post_id ) { |
| 55 | $notification_sent = get_post_meta($post_id, 'notification_sent_for_delete_project', true); | ||
| 56 | if(!$notification_sent){ | ||
| 57 | update_post_meta($post_id, 'notification_sent_for_delete_project', true); | ||
| 51 | $email = get_post_meta($post_id, 'wpsl_email', true); | 58 | $email = get_post_meta($post_id, 'wpsl_email', true); |
| 52 | $subject = 'WYN Registration Denied'; | 59 | $subject = 'WYN Registration Denied'; |
| 53 | $message = file_get_contents('https://fp-canada.gotenzing.com/wp-content/themes/understrap-child/inc/Registration-Denied.html'); | 60 | $message = file_get_contents(get_site_url().'wp-content/themes/understrap-child/inc/Registration-Denied.html'); |
| 54 | 61 | ||
| 55 | $headers_customer = array('Content-Type: text/html; charset=UTF-8'); | 62 | $headers_customer = array('Content-Type: text/html; charset=UTF-8'); |
| 56 | wp_mail( $email , $subject, $message, $headers_customer); | 63 | wp_mail( $email , $subject, $message, $headers_customer); |
| 57 | 64 | } | |
| 58 | } | 65 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment