Page 1 of 1

Subscribe without registration

Posted: Tue Jun 14, 2022 9:02 am
by LeeFoster
I am working on a footer module that will allow users to subscribe to a news letter without actually registering an account.

What I'm wondering is what is the best way to handle storing the email address? Do I put it in the customers table or create a table of its own? If I put it in the user table how do I handle it when a customer decides to register?

Any feedback is welcome.

Re: Subscribe without registration

Posted: Tue Jun 14, 2022 9:20 am
by burt
Make a module that asks for the following;
- name
- email address

On submit, place this info into a NEW db table.

Caveat: You might check the email address to see if a customer already exists, if so, simply update customers.customers_newsletter to 1.

Either way, existing customer set to 1 or new non-customer, messagestack to let them know they have been signed up to newsletter.

In the admin side newsletter functionality, the newsletter "send to" list is built.
Where/when this is built add in the extra subscribers from the new table.

--

On creation of an account, check to see if the customers email address matches any in the NEW db table, and if so...delete it from the NEW db table.

Caveat: You might also then update the customers.customers_newsletter to 1 (even if they selected "no newsletter" and advise them of this via a messagestack.

As you can probably tell, this is something I have already done, but it was a long time ago, probably pre phoenix.

Re: Subscribe without registration

Posted: Tue Jun 14, 2022 10:02 am
by LeeFoster
burt wrote: Tue Jun 14, 2022 9:20 am Make a module that asks for the following;
- name
- email address

On submit, place this info into a NEW db table.

Caveat: You might check the email address to see if a customer already exists, if so, simply update customers.customers_newsletter to 1.

Either way, existing customer set to 1 or new non-customer, messagestack to let them know they have been signed up to newsletter.

In the admin side newsletter functionality, the newsletter "send to" list is built.
Where/when this is built add in the extra subscribers from the new table.

--

On creation of an account, check to see if the customers email address matches any in the NEW db table, and if so...delete it from the NEW db table.

Caveat: You might also then update the customers.customers_newsletter to 1 (even if they selected "no newsletter" and advise them of this via a messagestack.

As you can probably tell, this is something I have already done, but it was a long time ago, probably pre phoenix.
It's good to hear you've done it before, means I'm not an idiot for trying to do it.

Re: Subscribe without registration

Posted: Tue Jun 14, 2022 10:56 am
by Kofod95
I actually have something similar as well, but haven't released it yet, as it's tied in with a lot of other stuff:
Can be seen here: https://friiskaffeogte.dk/ny/news.php

I created a customer with an empty password and newsletter = 1, which works, but obviously have some flaws. I plan on improving it and releasing it, but exams takes most of my time right now, and afterwards I have a 1.0.4.0-shop with 62 add-ons to update, so it will be a while before I can move this further.

This is what is in use in the link above:
newsletter_page_1_0_0.zip
Hopefully that will provide some inspiration for you!

//Daniel

Re: Subscribe without registration

Posted: Tue Jun 14, 2022 12:21 pm
by LeeFoster
Thanks to @burt's advice and @Kofod95 for sharing his work. I was quickly able to come up with the attached.

Users will need to create a table called subscriber with the columns id & email_address.

The module displays an text box for entering an email address and a submit button. It then checks if the email exists in customers, updating it if it does, adding it to the new table if it does not.

That's as far as I have gotten for now but thought I'd share this in case people want to use and improve it.
footer newsletter.rar

Re: Subscribe without registration

Posted: Wed Jun 15, 2022 4:56 pm
by Omar_one
@LeeFoster Maybe it's too late for my comment ,
I used on our frozen version an old module called Mailchimp newsletter Everywhere that module allow you to implement a newsletter subscription in the footer via mailchimp for your anonymous customers.
it will not sort anything in the databases..

Re: Subscribe without registration

Posted: Sat Nov 04, 2023 9:19 am
by lecarlb
@LeeFoster or anyone,

How to create subscriber table using SQL? And are any of the tep queries deprecated?

Thank you.

Re: Subscribe without registration

Posted: Sun Nov 05, 2023 8:42 am
by LeeFoster
lecarlb wrote: Sat Nov 04, 2023 9:19 am @LeeFoster or anyone,

How to create subscriber table using SQL? And are any of the tep queries deprecated?

Thank you.
The table is just the 2 columns ID and Email. Something like this should do the trick-

Code: Select all

CREATE TABLE `subscriber` (
  `id` int(11) NOT NULL,
  `email_address` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;