2

do you have any reference that can share, how to create a CMS page that has a newsletter subscription form in it? I don't need an extra column for the data. Once the user subscribes there, it will automatically create a record at the newsletter subscription page, and also send a confirmation email to the subscriber, just like filling out the newsletter subscription box at all the pages.

enter image description here

1 Answer 1

3

You can create new CMS page from

Admin->Content->Pages->Add New Page

Page Title = Newsletter /*As you want*/
Content Heading = Subscribe to our Newsletter /*As you want*/

Then add the below content in Body

{{block class="Magento\Newsletter\Block\Subscribe" name="static.newsletter" template="Magento_Newsletter::subscribe.phtml"}}

It will create a page with a Newsletter subscription form and save the data.

Check the below screenshots.

CMS page.

enter image description here

Saved Data.

enter image description here

5
  • Thanks, what about customer first name and last name? Possible to create custom block for it?
    – Paul Fan
    Mar 4, 2020 at 5:06
  • You have to create a module to save the additional fields for the guest subscriber, Check this: magento.stackexchange.com/a/201242/59677 or registered customer automatically saves the first name and last name, Also please accept the answer if my answer is worked for you. Mar 4, 2020 at 5:10
  • I did check this solution out too, but I have no idea why need to install Schema, I saw the Customer Firstname and Lastname field should there already.
    – Paul Fan
    Mar 4, 2020 at 16:58
  • I found out subscriber table has no field contain firstname and lastname, firstname and lastname is base on the customer_id, if customer_id is 0, then they are the guest.
    – Paul Fan
    Mar 5, 2020 at 0:41
  • Is my answer worked for you? Mar 5, 2020 at 3:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.