コード例 #1
0
    def send_auto_reply(self, communication, email):
        """Send auto reply if set."""
        if self.enable_auto_reply:
            set_incoming_outgoing_accounts(communication)

            if self.send_unsubscribe_message:
                unsubscribe_message = _("Leave this conversation")
            else:
                unsubscribe_message = ""

            frappe.sendmail(
                recipients=[email.from_email],
                sender=self.email_id,
                reply_to=communication.incoming_email_account,
                subject=_("Re: ") + communication.subject,
                content=render_template(self.auto_reply_message or "",
                                        communication.as_dict()) or
                frappe.get_template("templates/emails/auto_reply.html").render(
                    communication.as_dict()),
                reference_doctype=communication.reference_doctype,
                reference_name=communication.reference_name,
                in_reply_to=email.mail.get(
                    "Message-Id"),  # send back the Message-Id as In-Reply-To
                unsubscribe_message=unsubscribe_message,
            )
コード例 #2
0
	def send_auto_reply(self, communication, email):
		"""Send auto reply if set."""
		if self.enable_auto_reply:
			set_incoming_outgoing_accounts(communication)

			frappe.sendmail(recipients = [email.from_email],
				sender = self.email_id,
				reply_to = communication.incoming_email_account,
				subject = _("Re: ") + communication.subject,
				content = render_template(self.auto_reply_message or "", communication.as_dict()) or \
					 frappe.get_template("templates/emails/auto_reply.html").render(communication.as_dict()),
				reference_doctype = communication.reference_doctype,
				reference_name = communication.reference_name,
				in_reply_to = email.mail.get("Message-Id"), # send back the Message-Id as In-Reply-To
				unsubscribe_message = _("Leave this conversation"))
コード例 #3
0
	def send_auto_reply(self, communication, email):
		"""Send auto reply if set."""
		if self.enable_auto_reply:
			set_incoming_outgoing_accounts(communication)

			frappe.sendmail(recipients = [email.from_email],
				sender = self.email_id,
				reply_to = communication.incoming_email_account,
				subject = _("Re: ") + communication.subject,
				content = render_template(self.auto_reply_message or "", communication.as_dict()) or \
					 frappe.get_template("templates/emails/auto_reply.html").render(communication.as_dict()),
				reference_doctype = communication.reference_doctype,
				reference_name = communication.reference_name,
				message_id = communication.name,
				unsubscribe_message = _("Leave this conversation"),
				bulk=True)