/**
		 * Send email to new users
		 */
		public function triggerSendSignUpEmail($member_args)
		{
			$site_module_info = Context::get('site_module_info');
			$module_srl = $site_module_info->index_module_srl;

			$shop = new ShopInfo($module_srl);

			// Don't send anything if sender and receiver email addresses are missing
			if(!$shop->getEmail() || !$member_args->email_address)
			{
				ShopLogger::log("Failed to send welcome email to user. Member email is not set." . print_r($member_args, TRUE));
				return;
			}

			global $lang;
			$email_subject = sprintf($lang->new_member_email_subject
				, $shop->getShopTitle()
			);

			$email_content = sprintf($lang->new_member_email_content
				, getFullSiteUrl('', 'act', 'dispShopHome')
				, $shop->getShopTitle()
				, getFullSiteUrl('', 'act', 'dispShopMyAccount')
				, getFullSiteUrl('', 'act', 'dispShopHome')
				, $shop->getShopTitle()
			);

			$oMail = new Mail();
			$oMail->setTitle($email_subject);
			$oMail->setContent($email_content);
			$oMail->setSender($shop->getShopTitle(), $shop->getShopEmail());
			$oMail->setReceiptor(FALSE, $member_args->email_address);
			$oMail->send();
		}
Example #2
0
 /**
  * Send email to user notifying him of the newly created order
  */
 public static function sendNewOrderEmails($order_srl)
 {
     $repo = new OrderRepository();
     $order = $repo->getOrderBySrl($order_srl);
     $shop = new ShopInfo($order->module_srl);
     // Don't send anything if shop email is not configured
     if (!$shop->getShopEmail()) {
         ShopLogger::log("Failed to send order email for order #{$order->order_srl}; Shop email is not configured");
         return;
     }
     self::sendNewOrderMailToCustomer($shop, $order);
     self::sendNewOrderMailToAdministrator($shop, $order);
 }