Get the html of an email, searching by subject.
        @Params
        email_name - the subject to search for
        @Returns
        HTML content of the matched email
16820
def fetch_html_by_subject(self, email_name):
        
        if not email_name:
            raise EmailException("Subject cannot be null")

        results = self.__imap_search(SUBJECT=email_name)
        sources = self.fetch_html(results)

        return sources
196554
def get(self):
        
        email = {}
        if self.name is not None:
            email["name"] = self.name

        if self.email is not None:
            email["email"] = self.email
        return email
15828
function getOverriddenEmail(email: string): string {
  if (!cfg.email.devEmail) {
    throw new Error("Email failed to send: cfg.email.devEmail is not set");
  }
  const devEmailParts = cfg.email.devEmail.split("@");
  return `${devEmailParts[0]}+${email.replace("@", ".at.")}@${
    devEmailParts[1]
  }`;
}
109816
def parse_email(self, email_info):
        
        name, email = rfc822.parseaddr(email_info)

        # more than likely a string was passed here instead of an email address
        if "@" not in email:
            name = email
            email = None

        if not name:
            name = None

        if not email:
            email = None

        self.name = name
        self.email = email
        return name, email
489233
def send_templated_mail(tpl, subject, context, to=getattr(settings, 'MIDNIGHT_MAIN_ADMIN_EMAIL', 'admin@example.com')):
    
    msg_html = render_to_string(tpl, {'context': context})

    send_mail(subject, '', getattr(settings, 'MIDNIGHT_MAIN_MAIL_FROM', 'admin@example.com'),  [to], html_message=msg_html,)
405584
def parse_email_for_anchor_text_link(email, link_text)
      if email.multipart?
        body = email.html_part.body
      else
        body = email.body
      end
      if match_data = body.match(%r{<a[^>]*href=['"]?([^'"]*)['"]?[^>]*?>[^<]*?#{link_text}[^<]*?</a>})
        match_data[1]
      end
    end
104233
def show
      prevent_browser_caching
      cms_edit_links!
      with_email_locale do
        if @preview.respond_to?(:preview_mail)
          @mail, body     = mail_and_body
          @mail_body_html = render_to_string(inline: body, layout: 'rails_email_preview/email')
        else
          raise ArgumentError.new("#{@preview} is not a preview class, does not respond_to?(:preview_mail)")
        end
      end
    end
518342
def get_email_template(name, language=''):
    
    use_cache = getattr(settings, 'POST_OFFICE_CACHE', True)
    if use_cache:
        use_cache = getattr(settings, 'POST_OFFICE_TEMPLATE_CACHE', True)
    if not use_cache:
        return EmailTemplate.objects.get(name=name, language=language)
    else:
        composite_name = '%s:%s' % (name, language)
        email_template = cache.get(composite_name)
        if email_template is not None:
            return email_template
        else:
            email_template = EmailTemplate.objects.get(name=name,
                                                       language=language)
            cache.set(composite_name, email_template)
            return email_template
1185579
def __search_email_by_subject(self, subject, match_recipient):
        ""
        if match_recipient is None:
            _, data = self._mail.uid('search',
                                     None,
                                     '(HEADER SUBJECT "{subject}")'
                                     .format(subject=subject))

            uid_list = data[0].split()
            return uid_list
        else:
            _, data = self._mail.uid('search',
                                     None,
                                     '(HEADER SUBJECT "{subject}" TO "{recipient}")'
                                     .format(subject=subject, recipient=match_recipient))

            filtered_list = []
            uid_list = data[0].split()
            for uid in uid_list:
                # Those hard coded indexes [1][0][1] is a hard reference to the message email message headers
                # that's burried in all those wrapper objects that's associated
                # with fetching a message.
                to_addr = re.search(
                    "[^-]To: (.*)", self._mail.uid('fetch', uid, "(RFC822)")[1][0][1]).group(1).strip()

                if (to_addr == match_recipient or to_addr == "<{0}>".format(match_recipient)):
                    # Add matching entry to the list.
                    filtered_list.append(uid)

            return filtered_list
923535
def send_email(name, ctx_dict, send_to=None, subject=u'Subject', **kwargs):
    

    eft = EmailFromTemplate(name=name)
    eft.subject = subject
    eft.context = ctx_dict
    eft.get_object()
    eft.render_message()
    eft.send_email(send_to=send_to, **kwargs)
877485
def get_recipients(self, name):
        
        to_str = self.render_string(self.data[name])
        formatted_emails = [
            email.utils.formataddr(addr_pair)
            for addr_pair in email.utils.getaddresses([to_str])
        ]
        return [i for i in formatted_emails if i]
791196
public function previewContentWithHTML($content_html, $email) {
        $data = [ ];
        $data['content_html'] = $content_html;
        $data['email'] = $email;

        $result = $this->apiPost('preview', $data);
        return $result;
    }
1075648
def send_html_mail(subject, message, message_html, from_email, recipient_list,
                   priority=None, fail_silently=False, auth_user=None,
                   auth_password=None, headers={}):
    
    from django.utils.encoding import force_text
    from django.core.mail import EmailMultiAlternatives
    from mailer.models import make_message

    priority = get_priority(priority)

    # need to do this in case subject used lazy version of ugettext
    subject = force_text(subject)
    message = force_text(message)

    msg = make_message(subject=subject,
                       body=message,
                       from_email=from_email,
                       to=recipient_list,
                       priority=priority)
    email = msg.email
    email = EmailMultiAlternatives(
        email.subject,
        email.body,
        email.from_email,
        email.to,
        headers=headers
    )
    email.attach_alternative(message_html, "text/html")
    msg.email = email
    msg.save()
    return 1
110533
def replace_and_send_mail_safely(mail, recipient)
      html_body = mail.html_part.body.raw_source
      do_custom_replacements_for(mail, recipient)
      send_raw_email_safely(mail)
      mail.html_part.body = html_body
    end
517714
public OvhMailingList domain_mailingList_name_GET(String domain, String name) throws IOException {
		String qPath = "/email/domain/{domain}/mailingList/{name}";
		StringBuilder sb = path(qPath, domain, name);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhMailingList.class);
	}
594968
def get_webnames_from_search(html)
      user_links = Nokogiri::HTML(html).css('.user_name a')
      webnames = []

      user_links.each do |link|
        webnames << link['webname']
      end

      webnames
    end
848451
def search(self):
        
        requests = self._format()
        serps = self._fetch(requests)
        urls = self._process(serps)
        details = self._fetch(urls)
        emails = self._extract()
        return {'emails': emails, 'processed': len(self.data)}