/** * This queues up and sends an email requesting the registrant to confirm * the registration. */ public function SendConfirmationEmail() { // Template $strTemplateName = 'registration'; // Calculate Email Address - THIS WILL RETURN if none is found $strFromAddress = 'ALCF my.alcf Registration <*****@*****.**>'; $strToAddress = $this->strEmailAddress; $strSubject = 'Your Online Registration'; // Setup the SubstitutionArray $strArray = array(); // Setup Always-Used Fields $strArray['PERSON_NAME'] = $this->strFirstName . ' ' . $this->strLastName; // Add Payment Info $strArray['URL'] = $this->ConfirmationUrl . '/' . $this->strConfirmationCode; $strArray['CODE'] = $this->strConfirmationCode; $strArray['USERNAME'] = $this->PublicLogin->Username; $strArray['CONTACT'] = strip_tags(Registry::GetValue('contact_sentence_my_alcf_support')); OutgoingEmailQueue::QueueFromTemplate($strTemplateName, $strArray, $strToAddress, $strFromAddress, $strSubject); }
/** * This will reset this publiclogin's password and will email the new password to the email account on file. * If no primary email address this will throw an exception. * @return string */ public function ResetPassword() { if (!$this->Person->PrimaryEmail->Address) { throw new QCallerException('ResetPassword for a PublicLogin record with no attached primary email: ' . $this->Id); } $strTemporaryPassword = str_replace('0', '', str_replace('1', '', md5(microtime()))); $strTemporaryPassword = substr($strTemporaryPassword, 0, 6); $this->SetPassword($strTemporaryPassword); $this->TemporaryPasswordFlag = true; $this->Save(); // Setup email info $strFromAddress = 'ALCF my.alcf Account Support <*****@*****.**>'; $strToAddress = $this->Person->PrimaryEmail->Address; $strSubject = 'Account Support: Your Temporary Password'; // Setup the SubstitutionArray $strArray = array(); // Setup Always-Used Fields $strArray['PERSON_NAME'] = $this->Person->Name; $strArray['PASSWORD'] = $strTemporaryPassword; $strArray['CONTACT'] = strip_tags(Registry::GetValue('contact_sentence_my_alcf_support')); OutgoingEmailQueue::QueueFromTemplate('reset_password', $strArray, $strToAddress, $strFromAddress, $strSubject); return $strTemporaryPassword; }
/** * This will send a confirmation email for the OnlineDonation item * @param string $strToAddress an explicitly set EmailAddress to send, or if null, it will try and deduce it from the attached person record */ public function SendConfirmationEmail($strToAddress = null) { // Template $strTemplateName = 'online_donation'; // Calculate Email Address - THIS WILL RETURN if none is found $strFromAddress = 'ALCF Online Donation <*****@*****.**>'; if (!$strToAddress) { $strToAddress = $this->CalculateConfirmationEmailAddress(); } if (!$strToAddress) { return; } $strSubject = 'Your Online Donation'; // Setup the SubstitutionArray $strArray = array(); // Setup Always-Used Fields $strArray['PERSON_NAME'] = $this->Person->Name; $strArray['ONLINE_DONATION_ID'] = sprintf('%05s', $this->Id); // Add Payment Info $strArray['AMOUNT'] = QApplication::DisplayCurrency($this->Amount); $strArray['CREDIT_CARD'] = $this->CreditCardPayment->CreditCardDescription; $strProductArray = array(); foreach ($this->GetOnlineDonationLineItemArray() as $objLineItem) { $strProductArray[] = sprintf('%s - %s', $objLineItem->StewardshipFund ? $objLineItem->StewardshipFund->ExternalName : $objLineItem->Other, QApplication::DisplayCurrency($objLineItem->Amount)); } $strArray['PAYMENT_ITEMS'] = implode("\r\n", $strProductArray); OutgoingEmailQueue::QueueFromTemplate($strTemplateName, $strArray, $strToAddress, $strFromAddress, $strSubject, null, trim(Registry::GetValue('donation_receipt_bcc'))); }
/** * Queues a "confirmation email" to be sent out to the person signing up * @param SignupPayment $objSignupPayment an OPTIONAL SignupPayment for the payment that was "just submitted" and to be incorporated into the email message */ public function SendConfirmationEmail(SignupPayment $objSignupPayment = null) { // Setup the SubstitutionArray $strArray = array(); // Setup Always-Used Fields if (!$this->PersonId) { $strArray['PERSON_NAME'] = sprintf("%s %s", $this->CommunicationsEntry->FirstName, $this->CommunicationsEntry->LastName); } else { $strArray['PERSON_NAME'] = $this->Person->Name; } $strArray['SIGNUP_FORM_NAME'] = $this->SignupForm->Name; $strArray['SIGNUP_ENTRY_ID'] = sprintf('%05s', $this->Id); $strArray['SUPPORT_EMAIL'] = $this->SignupForm->SupportEmail; // Add a Description $strArray['SIGNUP_DESCRIPTION'] = null; if ($strDescription = trim($this->SignupForm->Description)) { $strArray['SIGNUP_DESCRIPTION'] = $strDescription; } else { switch ($this->SignupForm->SignupFormTypeId) { case SignupFormType::Event: if ($strDescription = $this->SignupForm->EventSignupForm->GeneratedDescription) { $strArray['SIGNUP_DESCRIPTION'] = 'Event ' . trim(substr($strDescription, 1)) . '.'; } break; } } // Add URL to the Description (if applicable) if ($strUrl = trim($this->SignupForm->InformationUrl)) { $strArray['SIGNUP_DESCRIPTION'] = trim($strArray['SIGNUP_DESCRIPTION'] . ' For more information, please go to ' . $strUrl); } // Add Payment Info (if applicable) if ($objSignupPayment) { $strArray['AMOUNT'] = QApplication::DisplayCurrency($objSignupPayment->Amount); $strArray['CREDIT_CARD'] = $objSignupPayment->TransactionDescription; $strProductArray = array(); foreach ($this->GetSignupProductArray(QQ::OrderBy(QQN::SignupProduct()->FormProduct->FormProductTypeId, QQN::SignupProduct()->FormProduct->OrderNumber)) as $objSignupProduct) { $strProductArray[] = sprintf('%s - Qty %s - %s', $objSignupProduct->FormProduct->Name, $objSignupProduct->Quantity, QApplication::DisplayCurrency($objSignupProduct->Quantity * $objSignupProduct->Amount)); } $strArray['PAYMENT_ITEMS'] = implode("\r\n", $strProductArray); $strTemplateName = 'signup_entry_paid'; } else { $strTemplateName = 'signup_entry_unpaid'; } // Calculate Email Address $strFromAddress = 'ALCF Signup System <*****@*****.**>'; if (!($strToAddress = $this->CalculateConfirmationEmailAddress())) { $strToAddress = $strFromAddress; } $strBccAddress = trim($this->SignupForm->EmailNotification); $strSubject = 'Your Signup for ' . $this->SignupForm->Name; OutgoingEmailQueue::QueueFromTemplate($strTemplateName, $strArray, $strToAddress, $strFromAddress, $strSubject, null, $strBccAddress); }