X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-send_coupon.php;h=84309479f8c63f8d0573fcdd9cde9562c6d0a055;hb=697b58fb2ea96a64370d9f8d23e2f8d414385d79;hp=b304dbe7bada516e5bf1f2f642d5d2af1ee3c620;hpb=964a3b539e335f6d70e7779630fd3d25fd38398d;p=mailer.git diff --git a/inc/modules/admin/what-send_coupon.php b/inc/modules/admin/what-send_coupon.php index b304dbe7ba..84309479f8 100644 --- a/inc/modules/admin/what-send_coupon.php +++ b/inc/modules/admin/what-send_coupon.php @@ -108,7 +108,7 @@ if (isFormSent()) { ); // Load member email template - $mailText = loadEmailTemplate('member_coupon', $content, $userid); + $mailText = loadEmailTemplate('member_coupon_code', $content, $userid); // And deliver it sendEmail($userid, '{--MEMBER_COUPON_SUBJECT--}', $mailText); @@ -116,24 +116,27 @@ if (isFormSent()) { // Rember this user for the admin email $adminUserids[] = $userid; } // END - while + + // Prepare content for template + $content = array( + 'userids' => implode(',', $adminUserids), + 'userid_count' => count($adminUserids), + 'coupon_id' => $couponId, + 'points' => bigintval(postRequestParameter('points')), + 'coupon_description' => postRequestParameter('coupon_description'), + 'coupon_expired' => generateDateTime($expirationTime, '0') + ); + + // Send admin notification + sendAdminNotification('{--ADMIN_COUPON_SUBJECT--}', 'admin_coupon_code', $content); + + // Coupon has been sent + displayMessage('{--ADMIN_SEND_COUPON_DONE--}'); } else { // No user was found displayMessage('{--ADMIN_SEND_COUPON_USER_404--}'); } - // Prepare content for template - $content = array( - 'userids' => implode(',', $adminUserids), - 'userid_count' => count($adminUserids), - 'coupon_id' => $couponId, - 'points' => bigintval(postRequestParameter('points')), - 'coupon_description' => postRequestParameter('coupon_description'), - 'coupon_expired' => generateDateTime($expirationTime, '0') - ); - - // Send admin notification - sendAdminNotification('{--ADMIN_COUPON_SUBJECT--}', 'admin_coupon', $content); - // Free result SQL_FREERESULT($result); }