Add option to subscribe to AcyMailing at guest buy

  • Posts: 36
  • Thank you received: 0
12 years 6 months ago #51891

Is there an easy way to have a tickbox in the address form which allows an opt-in on a certain AcyMailing?

I only sell without registration, so guest only.

Please Log in or Create an account to join the conversation.

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
12 years 6 months ago #51894

For a checkout with registration, it is already possible with that pluginof AcyMailing:
www.acyba.com/en/support/documentation/1...n-regacymailing.html
For a checkout without registration, it will require that this plugin implements the onAfterUserCreate trigger that we have in HikaShop. That plugin is developed by AcyMailing, so it should be something to ask them actually.

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
12 years 3 months ago #67506

utillis,
did you figure this out? might you be able to share the steps you took if you did?

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 0
12 years 3 months ago #67638

Nope, so far I have added a custom check field at the end of the checkout procedure. So now my database has the information. However I would have to create a script which runs after a successful buy which verifies this field in the database and if true adds the emailadress and customer name to the AcyMailing table with the wanted list IDs.

Until now my focus has been on other stuff.

Although I would be willing to pay a small fee if someone can make that script, even if the configuration of tables and list IDs are not in a Joomla plugin or something.

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
10 years 8 months ago #152292

I want to re-ignite this discussion. Does anyone have a solution for this yet?

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 0
10 years 8 months ago #152306

I don't have one yet. Would be a nice one for freelance.com or something like that.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #152579

Hi,

This will require a custom plugin for such action.
So a PHP developer is required, you can post a request on our Commercial jobs section, there is potentially developers which can develop that for you.

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
10 years 7 months ago #154178

Ok so I have done it (in a way). I am not at all a php developer so basically I went in search for a different solution, there are flaws in this solution (it takes the Subscribers Name from the first address created and it's a First Name only) but it will work in my situation and hopefully some others. Also worth noting that this solution copies the new user every 30 minutes... you can change this if you like by editing the query when creating the scheduled event.

The way to do it is via MySQL Event Scheduler Queries (5.1+). So here's how.
1. Login to your MySQL database and ensure that Event Scheduler is running by running the query:

SET GLOBAL event_scheduler =  "ON"

2. Login to your Joomla Backend and create two Hikashop Custom Fields (Components > Hikashop > Display > Custom Fields) as follows:
"Subscribe" as Radio Button field with two values "Yes" and "No" configured as follows:
Table: user Column name: subscribe Display: Font-end YES Back-end YES
"sub_user_name" as text field with no value configured as follows:
Table: user Column name: sub_user_name Display: NO for all

3.Once Created the Subscribe Yes/No should appear in the checkout

4. Go back to MySQL and run the following queries - PLEASE FILL IN YOUR DATABASE TABLE PREFIX WHERE "XXX" APPEARS IN THE QUERIES BELOW:
CREATE EVENT hikasub1
    ON SCHEDULE
      EVERY 30 MINUTE
    COMMENT 'Copies name from address to sub_user_name'
    DO
UPDATE 
    XXX_hikashop_user a, XXX_hikashop_address b
SET
    a.sub_user_name = b.address_firstname
WHERE
    a.user_id = b.address_user_id
CREATE EVENT hikasub2
    ON SCHEDULE
      EVERY 30 MINUTE
    COMMENT 'Copies from Hikashop to AcyMailing'
    DO
    INSERT INTO 
	XXX_acymailing_subscriber (name, email)
SELECT 
	sub_user_name, user_email FROM XXX_hikashop_user
WHERE 
	subscribe = 'Yes'
ON DUPLICATE KEY UPDATE
	subid=subid
CREATE EVENT hikasub3
    ON SCHEDULE
      EVERY 30 MINUTE
    COMMENT 'Sets timestamp on new subscriber row'
    DO
 UPDATE
	XXX_acymailing_subscriber
SET 
	created = UNIX_TIMESTAMP()
WHERE 
	created IS NULL
This step Adds the user to the Newsletter with the ID 1 if you want to subscribe them to another list just change the "1" at the beginning of the "SELECT" query.
CREATE EVENT hikasub4
    ON SCHEDULE
      EVERY 30 MINUTE
    COMMENT 'Adds the new user to subscription list'
    DO
INSERT INTO 
	 XXX_acymailing_listsub (listid, subid, subdate, status)
SELECT 
	1, XXX_acymailing_subscriber.subid, XXX_acymailing_subscriber.created, 1
FROM
	XXX_acymailing_subscriber
ON DUPLICATE KEY UPDATE
	listid=listid
5. Test it! REMEMBER: It will take up to 30 minutes for the new user to be added to AcyMailing...

Hopefully this sets someone on the right track... It's fairly basic and I am sure anyone with PHP knowledge could make this work much better but I have a limited budget for my project and I also learnt some stuff on the way!

Chris

Last edit: 10 years 7 months ago by bullantmm.

Please Log in or Create an account to join the conversation.

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
10 years 7 months ago #154244

Hi,

Thanks for sharing a solution.

We've shared with the AcyMailing team the code necessary in their plugin to handle the guest mode of HikaShop.
They just need to review it, accept it and release it and it should work automatically with the (auto)subscription on Joomla registration plugin of AcyMailing.

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
10 years 7 months ago #154288

Yeah no worries. My solution is a little more user friendly because it only adds people if the say "yes" to subscribing, the AcyMailing auto plugin just registers everyone.

Please Log in or Create an account to join the conversation.

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
10 years 7 months ago #154296

No, the AcyMailing plugin can also ask the clients if they want to subscribe or not.
You have the option "Lists displayed on registration form" for that.

Please Log in or Create an account to join the conversation.

Time to create page: 0.102 seconds
Powered by Kunena Forum