'Send auto reply if set.'

def send_auto_reply(self, communication, email):

    if self.enable_auto_reply:
        set_incoming_outgoing_accounts(communication)
        if self.send_unsubscribe_message:
            unsubscribe_message = _(u'Leave    this    conversation')
        else:
            unsubscribe_message = u''
        frappe.sendmail(recipients=[email.from_email], sender=self.email_id, reply_to=communication.incoming_email_account, subject=(_(u'Re:    ') + communication.subject), content=(render_template((self.auto_reply_message or u''), communication.as_dict()) or frappe.get_template(u'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(u'Message-Id'), unsubscribe_message=unsubscribe_message)
