Sending Email
Sending Email
Hello,
I wanted to know how to create a hook to send an email when an inserted field is equal to or less than a number.
example:
field STOCKS
when i enter a number that is 20 or lower than 20, the program sends an e-mail alert.
Can you help me to enter the code that allows this feature?
Thank you very much.
I wanted to know how to create a hook to send an email when an inserted field is equal to or less than a number.
example:
field STOCKS
when i enter a number that is 20 or lower than 20, the program sends an e-mail alert.
Can you help me to enter the code that allows this feature?
Thank you very much.
Re: Sending Email
You can do this with a simple IF
Something like
If( yourfield <= '80') { the code for sending email that you can get from the link below}
that is all.
http://bigprof.com/appgini/tips-and-tut ... ed-records
Something like
If( yourfield <= '80') { the code for sending email that you can get from the link below}
that is all.
http://bigprof.com/appgini/tips-and-tut ... ed-records
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper
Re: Sending Email
Thank you very much.
I know that the answer it's simple, but i'm a novice in php and sometime to find a solution is difficult.
I know that the answer it's simple, but i'm a novice in php and sometime to find a solution is difficult.
Re: Sending Email
Hello to all.
Seeking clarification:
this is the code that I inserted into the hooks
The problem I have when I send the email for the material FAIL {$data['Guasti']}, because in the field of the table shows the calculation, and in the email I have no result but a single number (such as 1, 8, etc ...).
How could I bring up the exact number of calculation in email?
I hope I have explained my problem!
How could I bring up the exact number of subtraction?
I hope I have explained my problem!
Can anyone help me?
Seeking clarification:
this is the code that I inserted into the hooks
Code: Select all
function giacenze_after_update($data, $memberInfo, &$args){
// calculate total
$id=$data['id'];
$Guasti = $data['Giacenza'] - $data['Disponibili'];
sql("update giacenze set Guasti='$Guasti' where id='$id'", $eo);
// to compose a message containing the submitted data,
if ($data['Disponibili'] <= '20'){
@mail(
// mail recipient
"[email protected]",
// subject
"ATTENZIONE! Scorta Minima raggiunta per {$data['Apparato']}",
// message
"Ciao {$memberInfo['username']},\n\n".
"Questo materiale ha raggiunto la scorta minima:\n\n".
"{$data['Apparato']}\n".
"Pezzi Disponibili: {$data['Disponibili']}\n\n".
"Per visualizzare il materiale sul DataBase clicca il link seguente:\n".
"http://appgini/table_view.php?SelectedID=$id",
// sender address
"From: [email protected]"
);
}
//if ($data['Guasti'] >= '50'){
@mail(
// mail recipient
"[email protected]",
// subject
"Eccessivo materiale GUASTO in magazzino per {$data['Apparato']}",
// message
"Ciao {$memberInfo['username']},\n\n".
"C'è un eccesso di materiale guasto in magazzino:\n\n".
"{$data['Apparato']}\n".
"Materiale Guasto {$data['Guasti']}.\n\n".
"Per visualizzare il materiale sul DataBase clicca sul link:\n".
"http://appgini/table_view.php?SelectedID=$id",
// sender address
"From: [email protected]"
);
}
return TRUE;
}
How could I bring up the exact number of calculation in email?
I hope I have explained my problem!
How could I bring up the exact number of subtraction?
I hope I have explained my problem!
Can anyone help me?
Re: Sending Email
Instead of try and use $data['Guasti'] rather than $Guasti in other parts of the code.
Code: Select all
$Guasti = $data['Giacenza'] - $data['Disponibili'];
Code: Select all
$data['Guasti'] = $data['Giacenza'] - $data['Disponibili'];
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Sending Email
Hello,
I entered the code $data['Guasti'], but when I update, I see a blank page.
Something does not work ...
I entered the code $data['Guasti'], but when I update, I see a blank page.
Something does not work ...
Re: Sending Email
A blank page probably means some syntax error ... it should be logged into the server error_log file .. could you check what's in there?
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Sending Email
Hallo,
in the error_log I haven't info or error.
When I change this code part
originial
with
or
I have a blank page.
in the error_log I haven't info or error.
When I change this code part
originial
Code: Select all
sql("update giacenze set Disponibili='$Disponibili' where id='$id'", $eo);
Code: Select all
sql("update giacenze set Disponibili='$data=['Disponibili']' where id='$id'", $eo);
Code: Select all
sql("update giacenze set Disponibili=$data=['Disponibili'] where id='$id'", $eo);
Re: Sending Email
I guess it should be
Code: Select all
sql("update giacenze set Disponibili='{$data['Disponibili']}' where id='$id'", $eo);
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Sending Email
Thank you Ahmad,
I try and let you know!
I try and let you know!
Re: Sending Email
The tested!
It does not work like that!
It does not work like that!
Re: Sending Email
See this for my detailed explanation on how too.. my lesson.. lOL http://forums.appgini.com/phpbb/viewtopic.php?f=7&t=850
Tina O'Connell
Web Dev & Appgini FAN
Web Dev & Appgini FAN
-
- Posts: 11
- Joined: 2013-08-07 17:15
Re: Sending Email
hi guys...
i have an email related issue..
I want to Email the attached file from a child / linked record.
so for instance i have an inquiry form about an item. i want to be able to email from the inquiry form the attached pdf related to that item that is in the items record. to be honest i would like to be able to attach multiple files like all files attached to that item as child records but lets keep it simple for now..
Glyn
i have an email related issue..
I want to Email the attached file from a child / linked record.
so for instance i have an inquiry form about an item. i want to be able to email from the inquiry form the attached pdf related to that item that is in the items record. to be honest i would like to be able to attach multiple files like all files attached to that item as child records but lets keep it simple for now..
Glyn