locomotivecms / engine

A platform to create, publish and edit sites
http://www.locomotivecms.com
Other
2.32k stars 625 forks source link

Custom SMTP Namespaces do not work with Password Reset Email Form #1387

Open greyskin opened 2 years ago

greyskin commented 2 years ago

The Locomotive CMS documentation references the following fields which allow a custom SMTP namespace in the metafields_schema.yml file:

Name Description
auth_email_smtp_namespace name of the site metafields namespace used to store your SMTP settings. Default: smtp
auth_email_smtp_address_alias name of the address property in the site metafields namespace. Default: address
auth_email_smtp_port_alias name of the port property in the site metafields namespace. Default: port
auth_email_smtp_user_name_alias name of the user_name property in the site metafields namespace. Default: user_name
auth_email_smtp_password_alias name of the user_name property in the site metafields namespace. Default: password

Using the auth template site here...

...and assuming the following in metafields_schema.yml:

smtp_settings:
  label: Outgoing Email
  fields:
    server:
      label: SMTP Server
      type: string

    username:
      label: Username
      type: string

    password:
      label: Password
      type: string

    port:
      label: Port
      type: string

...and the following data (replace with non-dummy) in site.yml:

metafields:
  smtp_settings:
    server: mailserveraddress.com
    username: email@address.com
    password: password
    port: 123

...and the following fields in on the forgot_password.liquid page:

<input type="hidden" name="auth_email_smtp_namespace" value="smtp_settings">
<input type="hidden" name="auth_email_smtp_address_alias" value="server">
<input type="hidden" name="auth_email_smtp_port_alias" value="port">
<input type="hidden" name="auth_email_smtp_user_name_alias" value="username">
<input type="hidden" name="auth_email_smtp_password_alias" value="password">

...we should be able to send a password reset email when a user registered to the site enters their email address in the Forgot Password form.

It doesn't work.

But if we use the default setup of the auth template site everything works as expected.

greyskin commented 2 years ago

@did this might need to be moved to Steam?