Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Send An Email Rate Topic   - - - - -

 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 15 May 2015 - 10:18 AM #1

Hi,

I want to send an email to the mail id's that were taken from a textbox.
Anyone please help me how to send the email, It is a high priority for me.



Regards,
Satya.

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19793 posts

Posted 15 May 2015 - 10:43 AM #2

I want to send an email to the mail id's that were taken from a textbox.
Anyone please help me how to send the email, It is a high priority for me.


Please clarify your request

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 15 May 2015 - 11:16 AM #3

Please clarify your request



Hi,

I want to send a referal link to register in the website for some mail-id (for eg., test@sample.com). This mail-id has been captured from a textbox.
When the receiver clicks on that referal link, He has to redirect to Registration page of the website.

Please help me how to send the referal link to the corresponding mail-id that was entered in the textbox.

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19793 posts

Posted 15 May 2015 - 12:19 PM #4

I am afraid, it is required to examine your custom code to answer on your question

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 16 May 2015 - 05:55 AM #5

I am afraid, it is required to examine your custom code to answer on your question


Here is my custom code.

function fn_referal($referal_email, $referal_user_id) {

$db_querry = db_get_row("SELECT * FROM ?:referal_links WHERE referal_email LIKE '%$referal_email%'");
if(!empty($db_querry)) {
return false;
}
else {
$referal_code = md5(uniqid());
$referal_date = date('Y-m-d H:i:s');
$firstname = db_get_field("SELECT firstname from ?:users WHERE user_id = '$referal_user_id'");
$db_que = db_query("INSERT INTO ?:referal_links (referal_code, referal_email, referar_user_id, referal_date, referal_status, referal_link_count) VALUES('$referal_code', '$referal_email', '$referal_user_id', '$referal_date', 'N', '1')");
return true;
}
}

Now i want to send an email to the “referal_email” after inserting the data into the ?:referal_links table.

  • I am getting the “$referal_email” value from the form and “$referal_user_id” is the $_SESSION['auth']['user_id'] value.

  • $referal_code is a unique id that was sending to the receiver(referal_email).

  • $referal_date is the date when the link is sending.

  • $firstname is the firstname from the ?:users table.

Regards,
Satya.

 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 16 May 2015 - 11:19 AM #6

Hi ,
Anybody please help me to fix the issue. It's a high priority to me.
Thanks in advance.

Regards,
Satya.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11401 posts

Posted 16 May 2015 - 07:43 PM #7

Search the 'functions' directory for 'Mailer' for examples of how the Mailer class is used. You will have to provide a template, template variables, etc. But if it's just simple text, you might want to just use the PHP mail function instead.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19793 posts

Posted 18 May 2015 - 08:49 AM #8

Hi , Anybody please help me to fix the issue. It's a high priority to me. Thanks in advance. Regards, Satya.


For example, please check the fn_send_usergroup_status_notification function in the app/functionc/fn.users.php file

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 19 May 2015 - 10:24 AM #9

For example, please check the fn_send_usergroup_status_notification function in the app/functionc/fn.users.php file

Search the 'functions' directory for 'Mailer' for examples of how the Mailer class is used. You will have to provide a template, template variables, etc. But if it's just simple text, you might want to just use the PHP mail function instead.


Hi,
Thanks for your help. As based on your suggestion, I written the following code,


$result = Mailer::sendMail(array(
'to' => $referal_email,
'from' => 'company_orders_department',
'data' => array(
'access_key' => $referal_key,

),
'tpl' => 'addons/communities/referal_link.tpl',
),'C');
if ($result) {
fn_set_notification('N', __('notice'), __('Referal Link Sent '));
}
else {
fn_set_notification('E', __('error'), __('Referal Link Not Sent'));
}

I also created the "referal_link.tpl" in the following file path,
design\themes\responsive\mail\templates\addons\communities
still the mail is not sent.

It was working well if any other predefined addon file path is given.

Please suggest me, If any code modifications is necessary with my code.

Regards,
Satya.

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19793 posts

Posted 19 May 2015 - 11:10 AM #10

Did you add the following code at the beginning of the file?

use Tygh\Mailer;

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 19 May 2015 - 12:04 PM #11

Did you add the following code at the beginning of the file?

use Tygh\Mailer;


Yes i added it..

 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 19 May 2015 - 12:38 PM #12

Did you add the following code at the beginning of the file?

use Tygh\Mailer;

Yes i added it, But still not working.

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19793 posts

Posted 19 May 2015 - 12:53 PM #13

Do you see the "Referal Link Sent" notification?

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 19 May 2015 - 01:03 PM #14

Do you see the "Referal Link Sent" notification?


No it was not showing any notification. It was just showing an empty screen.

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19793 posts

Posted 19 May 2015 - 03:02 PM #15

Please provide me with the temporary FTP access so that we can check it

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11401 posts

Posted 19 May 2015 - 07:08 PM #16

Did you look in your PHP error_log for an indication of a syntax error in your template? I.e. a Smarty error?

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • satya1328
  • Advanced Member
  • Trial users
  • Join Date: 23-Mar 15
  • 73 posts

Posted 20 May 2015 - 06:57 AM #17

Did you look in your PHP error_log for an indication of a syntax error in your template? I.e. a Smarty error?


I checked the error_log and it does't have any smarty error.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11401 posts

Posted 20 May 2015 - 06:05 PM #18

Then I would suggest you create a local_conf.php file in the root of your store and add the following code:
$my_dbg_ips = array(YOUR_IP_ADDRESS);
if( !empty($_SERVER['REMOTE_ADDR']) && in_array($_SERVER['REMOTE_ADDR'], $my_dbg_ips) && !defined('DEVELOPMENT') ) {
  define('DEVELOPMENT', true);
  ini_set('display_errors', true);
  error_reporting(E_ALL);
}
This will enable development mode and enable all PHP notices/errors/warnings to be sent to error_log and to the screen, but for your IP only. You can add other IP's to the array.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.