/** * Processes contact us form and sends email to merchant * * @service contact_us write * @param $fields */ public function save(Gpf_Rpc_Params $params) { $form = new Gpf_Rpc_Form($params); $subject = $this->getFieldValue($form, "subject"); $text = $this->getFieldValue($form, "text"); Gpf_Session::getAuthUser()->getPapUserId(); $user = new Pap_Common_User(); $user->setPrimaryKeyValue(Gpf_Session::getAuthUser()->getPapUserId()); try { $user->load(); } catch (Gpf_DbEngine_NoRowException $e) { $form->setErrorMessage($this->_("User cannot be found")); return $form; } $mailTemplate = new Pap_Mail_MerchantOnContactUs(); $mailTemplate->setUser($user); $mailTemplate->setEmail($subject, $text); $mailTemplate->addRecipient(Pap_Common_User::getMerchantEmail()); $mailTemplate->setFromEmail($user->getEmail()); $mailTemplate->setFromName($user->getFirstName()." ".$user->getLastName()); $mailTemplate->send(); $form->setInfoMessage($this->_("Email was successfully sent to merchant")); return $form; }
private function sendNotificationToMerchant(Pap_Contexts_Signup $context) { $context->debug('Sending notification email to merchant started'); $context->debug('Notification on new affiliate signup email is enabled, sending to address: '.Pap_Common_User::getMerchantEmail()); $this->sendMerchantNewUserSignupMail($context->getUserObject(), Pap_Common_User::getMerchantEmail()); $context->debug('Sending notification email to merchant ended'); }
private function sendNotificationToMerchant(Pap_Db_DirectLinkUrl $directLink) { $mail = new Pap_Mail_MerchantNewDirectLinkNotification($directLink); $mail->loadUser(Gpf_Session::getAuthUser()->getPapUserId()); $mail->addRecipient(Pap_Common_User::getMerchantEmail()); try { $mail->send(); } catch (Exception $e) { Gpf_Log::error($this->_('Error sending new direct link notification email to merchant: %s', $e->getMessage())); } }
/** * @param boolean $toMerchant */ private function createInvoiceMail($toMerchant) { if ($toMerchant) { $mailTemplate = new Pap_Mail_MerchantInvoice(); $mailTemplate->addRecipient(Pap_Common_User::getMerchantEmail()); $mailTemplate->setFromEmail($this->user->getEmail()); return $mailTemplate; } $mailTemplate = new Pap_Mail_AffiliateInvoice(); $mailTemplate->addRecipient($this->user->getEmail()); return $mailTemplate; }
protected function sendOnNewSaleNotificationEmail(Pap_Contexts_Action $context) { if (!$this->isSendingMailNotificationEnabled($context)) { $context->debug('Sending Sale summary mail not enabled. STOPPED'); return; } $mail = new Pap_Mail_SplitCommissionsMerchantOnSale($context->getTransaction()->getSaleId()); $mail->addRecipient(Pap_Common_User::getMerchantEmail()); try { $mail->send(); } catch (Gpf_Exception $e) { $context->debug('Sending Sale summary mail failed, possibly there was no transaction recorded during sale processing. STOPPED'); return; } $context->debug('Sending Sale summary mail sended. Ended'); }
private function getMerchantNotificationEmail(Pap_Common_Campaign $campaign) { $setting = new Gpf_Db_Setting(); $setting->setAccountId($campaign->getAccountId()); $setting->setName(Pap_Settings::MERCHANT_NOTIFICATION_EMAIL); try{ $setting->loadFromData(array(Gpf_Db_Table_Settings::ACCOUNTID, Gpf_Db_Table_Settings::NAME)); if($setting->getValue() != '') { return $setting->getValue(); } } catch (Gpf_Exception $e) { } return Pap_Common_User::getMerchantEmail(); }