getgrav / grav-plugin-email

Grav Email Plugin
http://getgrav.org
MIT License
37 stars 29 forks source link

Default Plugin yaml issue #184

Closed petrus9 closed 7 months ago

petrus9 commented 7 months ago

Here is what is in my config/plugins/email.yaml

enabled: true
from: 
to: 
mailer:
  engine: sendinblue
  smtp:
    server: localhost
    port: 25
    encryption: none
    user: null
    password: null
  sendmail:
    bin: /usr/sbin/sendmail
content_type: text/html
debug: true
from_name: Joe
to_name: Joe
cc: null
bcc: null
reply_to: null
body: null

The

from_name: Joe to_name: Joe

cause email to be sent to Joe and come from Joe.
if i remove the "Joe" in each field, and in the file and then save the plugin settings, it auto populates with Joe again. If I fully remove the both lines, it does not replace them when saving the settings and e-mails are no long sent to Joe or come from Joe.

Is this a bug?

what is the point of these fields when you already have the From and To fields at the top?

rhukster commented 7 months ago

I can't really make sense of your YAML because you didn't paste it between 'code' tags. It has lost all indents, and as YAML uses indents for formatting, the YAML you have pasted is actually invalid.

FYI though, the to and to_name syntax is older style and deprecated. You should be using RFC822 email addresses if you want to provide an email and a name: https://github.com/getgrav/grav-plugin-email?tab=readme-ov-file#specifying-email-addresses

Your example YAML does not include any entries for to: or from: which should be the actual email and the important part (e.g. joe@email.com). You can't have a to_name: without a to: to go along with it. Joe alone in to_name: is not a valid email address.

petrus9 commented 7 months ago

I deleted the email plugin and re-installed it from the repo's and this issue with the "Joe's" appearing in the email.yaml file disappeared. must have been a remanent form the skeleton them I installed. Thank you!