Sending email to selected customer
979593
public function send()
    {
        $blError = true;

        // error
        if (($sOxid = $this->getEditObjectId())) {
            $oPricealarm = oxNew(\OxidEsales\Eshop\Application\Model\PriceAlarm::class);
            $oPricealarm->load($sOxid);

            $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
            $sMailBody = isset($aParams['oxpricealarm__oxlongdesc']) ? stripslashes($aParams['oxpricealarm__oxlongdesc']) : '';
            if ($sMailBody) {
                $sMailBody = \OxidEsales\Eshop\Core\Registry::getUtilsView()->parseThroughSmarty($sMailBody, $oPricealarm->getId());
            }

            $sRecipient = $oPricealarm->oxpricealarm__oxemail->value;

            $oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
            $blSuccess = (int) $oEmail->sendPricealarmToCustomer($sRecipient, $oPricealarm, $sMailBody);

            // setting result message
            if ($blSuccess) {
                $oPricealarm->oxpricealarm__oxsended->setValue(date("Y-m-d H:i:s"));
                $oPricealarm->save();
                $blError = false;
            }
        }

        if (!$blError) {
            $this->_aViewData["mail_succ"] = 1;
        } else {
            $this->_aViewData["mail_err"] = 1;
        }
    }
298538
def send_invitation(self, user, sender=None, **kwargs):
        
        if user.is_active:
            return False
        token = self.get_token(user)
        kwargs.update({"token": token})
        self.email_message(
            user, self.invitation_subject, self.invitation_body, sender, **kwargs
        ).send()
        return True
499642
def set_sendemail_time(uid):
        '''
        
        '''
        entry = TabMember.update(
            time_email=tools.timestamp(),
        ).where(TabMember.uid == uid)
        entry.execute()
289520
public function enableCustomerEmail()
    {
        $this->data->email = new stdClass;
        $this->data->email->customer = new stdClass;

        $this->data->email->customer->enabled = true;

        return $this;
    }
1086926
def send_email(self):
        
        # send only if user notification setting is set to true
        if self.check_user_settings():
            send_mail(_(self.type), self.email_message, settings.DEFAULT_FROM_EMAIL, [self.to_user.email])
            return True
        else:
            # return false otherwise
            return False
1258470
function onChangeEmail() {
  var email = $('#changed-email').val();
  activeUser().updateEmail(email).then(function() {
    refreshUserData();
    alertSuccess('Email changed!');
  }, onAuthError);
}
76878
public function sendInviteMail($user)
    {
        $myConfig = Registry::getConfig();

        //sets language of shop
        $currLang = $myConfig->getActiveShop()->getLanguage();

        // shop info
        $shop = $this->_getShop($currLang);

        // mailer stuff
        $this->setFrom($user->send_email, $user->send_name);
        $this->setSmtp();

        // create messages
        $smarty = \OxidEsales\Eshop\Core\Registry::getUtilsView()->getSmarty();
        $this->setUser($user);

        $homeUrl = $this->getViewConfig()->getHomeLink();

        //setting recommended user id
        if ($myConfig->getActiveView()->isActive('Invitations') && $activeUser = $shop->getUser()) {
            $homeUrl = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->appendParamSeparator($homeUrl);
            $homeUrl .= "su=" . $activeUser->getId();
        }

        if (is_array($user->rec_email) && count($user->rec_email) > 0) {
            foreach ($user->rec_email as $email) {
                if (!empty($email)) {
                    $registerUrl = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->appendParamSeparator($homeUrl);
                    //setting recipient user email
                    $registerUrl .= "re=" . md5($email);
                    $this->setViewData("sHomeUrl", $registerUrl);

                    // Process view data array through oxoutput processor
                    $this->_processViewArray();

                    $this->setBody($smarty->fetch($this->_sInviteTemplate));

                    $this->setAltBody($smarty->fetch($this->_sInviteTemplatePlain));
                    $this->setSubject($user->send_subject);

                    $this->setRecipient($email);
                    $this->setReplyTo($user->send_email, $user->send_name);
                    $this->send();
                    $this->clearAllRecipients();
                }
            }

            return true;
        }

        return false;
    }
1305597
def send(self, send_to, from_who, subject, message, reply_to=None):
        
        # Set the reply to address if it's None
        if reply_to is None:
            reply_to = from_who

        try:
            em_msg = text.MIMEText(
                _text=message.encode('utf8'),
                _subtype='plain',
                _charset='utf8'
            )
            em_msg["Subject"] = subject
            em_msg["From"] = from_who
            em_msg["To"] = send_to
            em_msg["Reply-To"] = reply_to

            # Send Customer Messages
            built_message = em_msg.as_string()

            self.smtp.sendmail(
                from_addr=em_msg["From"],
                to_addrs=em_msg["To"],
                msg=built_message
            )
        except Exception as exp:
            msg = 'Failed to send message due to "%s"' % exp
            self.log.error(msg)
            raise cloudlib.MessageFailure(msg)
        else:
            self.log.debug(message)
        finally:
            self.smtp.quit()
488432
def deliver(template, from, to, vars={}, opts={})
      @info = vars
      @info[:company] = from[:name]

      mail(
        from: format_sender(from),
        to: to[:email],
        subject: humanize(template),
        template_path: 'system_notifications',
        template_name: template
      )
    end
408839
function Email (options) {
  this.action = options.action || SEND_EMAIL_ACTION;
  this.key = options.key;
  this.secret = options.secret;
  this.amazon = options.amazon;
  this.from = options.from;
  this.subject = options.subject;
  this.message = options.message;
  this.altText = options.altText;
  this.rawMessage = options.rawMessage;
  this.configurationSet = options.configurationSet;
  this.messageTags = options.messageTags;
  this.extractRecipient(options, 'to');
  this.extractRecipient(options, 'cc');
  this.extractRecipient(options, 'bcc');
  this.extractRecipient(options, 'replyTo');
}
323608
def send_email_template(slug, base_url=None, context=None, user=None,
                       to=None, cc=None, bcc=None, attachments=None, headers=None, connection=None, fail_silently=False):
    
    email_template = EmailTemplate.objects.get_for_slug(slug)

    email = email_template.get_email_message(
        base_url, context, user,
        to=to, cc=cc, bcc=bcc,
        attachments=attachments, headers=headers, connection=connection
    )

    return email.send(fail_silently=fail_silently)
181676
def _send(self, email_message):
		""""""
		if not email_message.recipients():
			return False
		from_email = email_message.from_email
		recipients = email_message.recipients()
		try:
			self.connection.messages.create(
				to=recipients,
				from_=from_email,
				body=email_message.body
			)
		except Exception:
			if not self.fail_silently:
				raise
			return False
		return True
716441
protected void sendEmail(TaskRuntimeContext context, String outcome)
    throws ObserverException {
        TaskInstance taskInstance = context.getTaskInstance();
        TemplatedEmail templatedEmail = new TemplatedEmail();
        templatedEmail.setFromAddress(getFromAddress());
        templatedEmail.setSubject(getSubject(taskInstance, outcome));
        templatedEmail.setHtml(true);
        templatedEmail.setTemplateAssetVerSpec(getTemplateSpec());
        templatedEmail.setRuntimeContext(context);

        try {
            List<Address> recipients = getRecipientAddresses(outcome);
            List<Address> ccRecipients = getCcRecipientAddresses(outcome);

            if (templatedEmail.getTemplateBody().contains("${taskActionUrl}")) {

                // send individual e-mails
                for (Address recip : recipients) {
                    String cuid = recip.toString().substring(0, recip.toString().indexOf('@'));
                    String userIdentifier = MiniCrypter.encrypt(cuid);
                    taskInstance.setUserIdentifier(userIdentifier);
                    templatedEmail.setRecipients(new Address[]{recip});
                    templatedEmail.setCcRecipients(new Address[0]);
                    try {
                        templatedEmail.sendEmail();
                    }
                    catch (MessagingException ex) {
                        logger.severeException(ex.getMessage(), ex);  // do not rethrow
                    }
                }
                if (ccRecipients != null) {
                    for (Address ccRecip : ccRecipients) {
                        String cuid = ccRecip.toString().substring(0, ccRecip.toString().indexOf('@'));
                        String userIdentifier = MiniCrypter.encrypt(cuid);
                        taskInstance.setUserIdentifier(userIdentifier);
                        templatedEmail.setRecipients(new Address[0]);
                        templatedEmail.setCcRecipients(new Address[]{ccRecip});
                        try {
                            templatedEmail.sendEmail();
                        }
                        catch (MessagingException ex) {
                            logger.severeException(ex.getMessage(), ex);  // do not rethrow
                        }
                    }
                }
            }
            else {
                if ((recipients != null && !recipients.isEmpty()) || (ccRecipients != null && !ccRecipients.isEmpty())) {
                    if (recipients != null)
                        templatedEmail.setRecipients(recipients.toArray(new Address[0]));
                    if (ccRecipients != null)
                        templatedEmail.setCcRecipients(ccRecipients.toArray(new Address[0]));
                    try {
                        templatedEmail.sendEmail();
                    }
                    catch (MessagingException ex) {
                        logger.severeException(ex.getMessage(), ex);  // do not rethrow
                    }
                }
                else {
                    logger.warn("WARNING: No email recipients for task " + context.getTaskInstanceId() + " " + outcome);
                }
            }
        }
        catch (Exception ex) {
            logger.severeException(ex.getMessage(), ex);
            throw new ObserverException(-1, ex.getMessage(), ex);
        }
    }
383496
protected function process()
    {

        // load email and website code
        $email = $this->getValue(ColumnKeys::EMAIL);
        $website = $this->getValue(ColumnKeys::WEBSITE);

        // query whether or not, we've found a new SKU => means we've found a new customer
        if ($this->hasBeenProcessed(array($email, $website))) {
            return;
        }

        // prepare the static entity values
        $customer = $this->initializeCustomer($this->prepareAttributes());

        // insert the entity and set the entity ID
        $this->setLastEntityId($this->persistCustomer($customer));
    }
399664
def send_activation_email(self, request, queryset):
        
        n = 0
        for user in queryset:
            if not user.is_active and settings.USERS_VERIFY_EMAIL:
                send_activation_email(user=user, request=request)
                n += 1

        self.message_user(
            request, _('Activation emails sent to %(count)d %(items)s.') %
            {'count': n, 'items': model_ngettext(self.opts, n)},  messages.SUCCESS)
1253662
public function sendTicket()
    {
        // Get the mail sender or fallback to the admin email
        if (empty($from = Reservation::config()->get('mail_sender'))) {
            $from = Config::inst()->get('Email', 'admin_email');
        }

        $email = new Email();
        $email->setSubject(_t(
            'AttendeeMail.TITLE',
            'Your ticket for {event}',
            null,
            array(
                'event' => $this->Event()->Title
            )
        ));
        $email->setFrom($from);
        $email->setTo($this->getEmail());
        $email->setTemplate('AttendeeMail');
        $email->populateTemplate($this);
        $this->extend('updateTicketMail', $email);
        return $email->send();
    }
1155894
public function send()
    {
        $oxEMail = oxNew(\OxidEsales\Eshop\Core\Email::class);
        $blSend = $oxEMail->sendNewsletterMail($this, $this->_oUser, $this->oxnewsletter__oxsubject->value);

        return $blSend;
    }