I am using the below nawk, to Send notifications.
Currently ,if Ind='Y' Then a member will be notified with a message which uses a template1 and FROM display would be :noreplyecommerceqa@test.com I want to change this to TEST1
and if Ind!='Y' Then a member should be notified with a message which uses a template2 and FROM display should be :TEST2 instead of noreplyecommerceqa@test.com
Currently ,if Ind='Y' Then a member will be notified with a message which uses a template1 and FROM display would be :noreplyecommerceqa@test.com I want to change this to TEST1
and if Ind!='Y' Then a member should be notified with a message which uses a template2 and FROM display should be :TEST2 instead of noreplyecommerceqa@test.com
Code:
{
sEmail = substr($0, 21, 50);
sRefNo = substr($0, 1, 20);
sAppID = substr($0, 71,6);
InD = substr($0, 81,1);
mail = "/usr/bin/mailx -b sithara@yahoo.com -r noreplyecommerce@test.com -s \"subject\" to_addr";
gsub("to_addr", sEmail, mail);
if ( sAppID == "MOS " )
{
if ( InD == "Y" )
{
gsub("subject","TEST 1 Notification ", mail);
system("sed \'s/<<ref_no>>/" sRefNo "/g\' template1 | " mail);
}
else
{
gsub("subject","TEST 2 Notification ", mail);
system("sed \'s/<<ref_no>>/" sRefNo "/g\' template2| " mail);
}
}
}