×

info

Dear guests,
You are currently on the old forum we kept as a knowledge base. You will find the new community forum here
Welcome, Guest
Username: Password: Remember me
Keyword

TOPIC: Hikashop /Acymailing / RS Form Pro

Hikashop /Acymailing / RS Form Pro 3 years 8 months ago #106483

  • Anonymous user
  • Gorazd974's Avatar
  • Posts: 3
  • Karma: 0
Hello,

I need to create a one time HIKA coupon code based on serial number that customer fills in in RSForm pro form and send the customer email with a thank you message and that coupon code.

I've managed to fill in AcyMailing group with that user with the usage of this PHP script (www.acyba.com/acymailing/127-acymailing-rsformpro.html#php), but I dont know how to generate coupon in HIKA and send the user thank you email...?

Any chance of pointing me somewhere or helping me out please?

Thank you
GG
Please log in to post a reply

Hikashop /Acymailing / RS Form Pro 3 years 8 months ago #106500

  • Alexandre
  • Alexandre's Avatar
  • Posts: 2462
  • Karma: 67
Hi,

You can take a look at our "generateCoupon" function which is used in our HikaShop plugin.
Regarding the newsletter sending process feel free to take a look at this documentation :
www.acyba.com/acymailing/64-acymailing-d...html#sendsingleemail
Please log in to post a reply

Hikashop /Acymailing / RS Form Pro 3 years 7 months ago #106550

  • Anonymous user
  • Gorazd974's Avatar
  • Posts: 3
  • Karma: 0
Thank you, I've set up newsletter and add this php code to form after being processed:
$postData = JRequest::getVar('form');
 
 include_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_acymailing'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php');
 
 $myUser = new stdClass();
 $myUser->email = strip_tags($postData['user_email']); //Please replace email_field by your own field name (the name of the field "email").
 $myUser->name = strip_tags($postData['user_name']) . ' ' . strip_tags($postData['user_surname']); //Please replace name_field by your own field name (the name of the field "name").
 $subscriberClass = acymailing_get('class.subscriber');
 
 $subscribe = array(1,17); //Specify here the ID of your lists separated by a comma, in this example the user will be subscribed to lists IDs 3,4 and 5.

 $subid = $subscriberClass->save($myUser);
 
 
$subscriberClass->sendConf($subid); //we send the confirmation email... only if needed based on the current user status and the option from the Acy configuration page.
 
 $newSubscription = array();
 if(!empty($subscribe)){
 foreach($subscribe as $listId){
 $newList = array();
 $newList['status'] = 1;
 $newSubscription[$listId] = $newList;
 }
 }
 $subscriberClass->saveSubscription($subid,$newSubscription);


$mailer = acymailing_get('helper.mailer');
$mailer->report = false; //set it to true or false if you want Acy to display a confirmation message or not (message successfully sent to...)
$mailer->trackEmail = true; //set it to true or false if you want Acy to track the message or not (it will be inserted in the statistics table)
$mailer->autoAddUser = false; //set it to true if you want Acy to automatically create the user if it does not exist in AcyMailing
$mailer->sendOne(66,$myUser->email); //The first parameter is the ID of the Newsletter you want to send or its namekey

It does the job of adding user to the lists and sending pre-made thank you message. Now, I would like to make a specific HIKA coupon for this user, say generated from user's inserted s/n. Any tips?
Please log in to post a reply

Hikashop /Acymailing / RS Form Pro 3 years 7 months ago #106564

  • Alexandre
  • Alexandre's Avatar
  • Posts: 2462
  • Karma: 67
Hi,

As I said in my previous post, feel free to take a look at our "generateCoupon" function which is used in our HikaShop plugin ;)
You will find all the information you need to generate an Hikashop coupon ;)
Please log in to post a reply

Hikashop /Acymailing / RS Form Pro 3 years 7 months ago #106616

  • Anonymous user
  • Gorazd974's Avatar
  • Posts: 3
  • Karma: 0
Yea I saw that, it allows you to generate "random" key. But how to generate it from serial number of the product, which user inserted in the rsform form previously...?
Please log in to post a reply

Hikashop /Acymailing / RS Form Pro 3 years 7 months ago #106648

  • Alexandre
  • Alexandre's Avatar
  • Posts: 2462
  • Karma: 67
Hi,

You should collect the data from the form thanks to the $postData variable and then use our function to save this value as coupon code ;)
Please log in to post a reply
Time to create page: 0.054 seconds
Powered by Kunena Forum