This topic is locked

Events: After record added

10/11/2007 12:16:50 AM
PHPRunner General questions
I
Idol author

Hi!
I wonder, how can I send a e-mail to a user who just added a new record with all his data...and at the same time send the same data to the admin's e-mail address?
And question number 2 is ...how can I display a message to the user who just added a record....I want to display to him something like this:
Your userID's number is: *****<-----the number
PS.And all these actions would take place 'After that the record was added'
Regards!

J
Jane 10/11/2007

Hi,
to send email to user and admin use After record added event on the Events tab.

Here is a sample code:

//** Send email with new data ****

$email="test@test.com";

$message="";

$subject="New data record";
foreach($values as $field=>$value)

$message.= $field." : ".$value."\r\n";
mail($email, $subject, $message);


To show message to the user use Display a message on the Web page action for the After record added event.

I
Idol author 10/11/2007

[quote name='Jane' post='22137' date=Oct 11 2007, 08:51 AM]Hi,
to send email to user and admin use After record added event on the Events tab.

Here is a sample code:
Hi Jane,

It's not working for me yet....I post the screen shots of what I do , and maybe you can point out where I do wrong!
Step 1,

I created a password/username field for the new user!


Step 2,

I pointed out the e-mail field!


Step 3,

I inserted the codes!


This one shows a message....but I want to show the user the random 'ID number' which he just got....I guess the code for this should be something like this
You id number is: "UserID".....or something like that....could you please help me!
Regards!

J
Jane 10/11/2007

Hi,
this event is just a sample code.

You need to adapt it to meet your needs. For example to send email to the admin you need to add the same code with another email to your AfterAdd event.
If you experience difficulties with this contact support team directly at [email=support@xlinesoft.com]support@xlinesoft.com[/email].

I
Idol author 10/11/2007

Hi,

this event is just a sample code.

You need to adapt it to meet your needs. For example to send email to the admin you need to add the same code with another email to your AfterAdd event.


Maybe I explained myself poorly!
This was the code which is working as long as I input a E-mail address of the reciver my self!...it's not automatic

//** Send email with new data ****

$email="test@test.com";

$message="";

$subject="New data record";
foreach($values as $field=>$value)

$message.= $field." : ".$value."\r\n";
mail($email, $subject, $message);


I need to put a code line instead of this line "test@test.com";
So that any user can add any e-mail address...and thereby recive a mail..regardless of his/her e-mail address!

(the e-mail field name is 'E-mail')....
Best regards

Alexey admin 10/11/2007

Try using this code:

$email=$values["E-mail"];

...

I
Idol author 10/11/2007

Alexey & Jane!
Thank you for your help....this function is working as I wished!
much appreciated!
Have a nice day!