Send for email the address url address added register
Hi, how to send by email the url address of the added register.
Thank very much.
Hi, how to send by email the url address of the added register.
Thank very much.
You may simply use "ew_SendEmail" global function. See the code in the generated phpfn*.php file.
Just refer to the generated <usertable>info.php file, for example, from the demo project, just refer to the "employeesinfo.php" file, and see the "PrepareRegisterEmail" function in it.
It still does not work correctly, I put it for discussion
$Email->Content .= "<BR>\n\r". "$url=carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id=". urlencode($this->carpeta_red_id->CurrentValue);
Thanks.
There is not "CurrentValue" in that event, that's why it won't work.
So please read "Server Events and Client Scripts" topic from PHPMaker Help menu for more info and example.
When I add a record to the table, the email is sent, in the body of the email is the link "URL", the user must click on the link and will be redirected to the record that was added, that's what I need;
The mail comes out of "Email_Sending"
$Email->Content .= "<BR>\n\r". "$url=carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id=". urlencode($this->carpeta_red_id->CurrentValue);
I think the structure is correct according to the example:
Example 3
If you have just added a master record and want to go to Grid-Add page of the detail table, enter: (with quotes)
"<DetailTable>list.php?a=gridadd&showmaster=<Table>&fk_<KeyField>=" . urlencode($this-><Field>->CurrentValue)
As I mentioned before, there is no "CurrentValue" property of the Field object in "Email_Sending" server event. Your code will never work if you are stil keep using "CurrentValue".
Please read "Server Events and Client Scripts" topic from PHPMaker Help menu, and see "Email_Sending" event for more info and example how to expose the value of the certain field.
I'm sending the "ID" in the mail but it does not reach me as Link; how can I add this part "h t t p://localhost:8081/project/"
Code:
$Email->Content .= "<BR>\n\r". "$url=carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}";
In the mail:
=carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id=2
Try:
echo substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) ."/";
It does not work.
$Email->Content .= "<BR>\n\r". "echo substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) ."/". carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}";
It does not work.
echo substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) ."/", "carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}";
mobhar wrote:
echo substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) ."/";
The "echo" is only for displaying the output. You should not include it if you want to concate the output with another string.
I think it is correct,
$Email->Content .= "<BR>\n\r". "substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) ."/". carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}";
In the body of the mail appears only "NAN" I need the link to go to the record that was added.
The URL is already in the mail when I add a record, now I try to convert the link into "CLICK HERE"
Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\project\carpetas_red_bitacorainfo.php on line 1300
$Email->Content .= "<BR>\n\r". <a href=substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) ."/". "carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}";>Click here</a>
Thanks.
Double check your code:
$Email->Content .= "<BR>\n\r". "substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) ."/". carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}";
It should be like the following:
$Email->Content .= "<BR>\n\r". substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) . "/carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}";
The URL is already in the mail when I add a record, now I try to convert the link into "CLICK HERE"
Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\project\carpetas_red_bitacorainfo.php on line 1300
$Email->Content .= "<BR>\n\r". <a href=substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) ."/". "carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}";>Click here</a>
Thanks.
Change:
$Email->Content .= "<BR>\n\r". <a href=substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) ."/". "carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}";>Click here</a>
to:
$Email->Content .= "<BR>\n\r<a href='" . substr(ew_FullUrl(), 0, strrpos( ew_FullUrl(), '/')) . "/carpetas_red_bitacoralist.php?showmaster=carpetas_red&fk_carpeta_red_id={$this->UrlEncode($Args['rsnew']['carpeta_red_bitacora_employee_id'])}'>Click here</a>";