Closed krtschmr closed 4 years ago
my mailer received an override
def mail(args) if current_user&.want_encrypted_mails? args[:gpg] = {encrypt: true, keys: {current_user.email => current_user.account_setting.pgp_public_key} } end super(args) end
quick verification of the args hash
{:to=>"test@test.de", :subject=>"Test mail", :template_path=>"mailers/deposit_mailer", :gpg=> {:encrypt=>true, :keys=> {"test@test.de"=> "-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nmQIN......................PN\r\n=KIA3\r\n-----END PGP PUBLIC KEY BLOCK-----"}}}
so this seem to look correct. however if i inspect the email, mail.body.encoded it's all in plaintext.
mail.body.encoded
what am i missing or what am i doing wrong?
Update:
since a user on reddit pointed it out: mail.body.encoded is always plain and only becomes encrypted if the mail is actually send out.
maybe we can change the docs accordingly
my mailer received an override
quick verification of the args hash
so this seem to look correct. however if i inspect the email,
mail.body.encoded
it's all in plaintext.what am i missing or what am i doing wrong?