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
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
Perform custom replacements and send the email without throwing any exception