cancel
Showing results for 
Search instead for 
Did you mean: 

email subject

pk1974
Occasional Contributor

email subject

Hi

Below is the content in the file, I am using email notification.

In the email subject I want to send as "DS Purchase Order No: ABCD for Account Number 11111

PURCHASE_ORDER_NO: ABCD
TRADING PARTNER ID: XYZ12345
ACCOUNT#: 11111
PURCHASE ORDER DATE: 20100924

How can I pick the two information from the file and place in the email subject, could you please advise me
10 REPLIES
Steven E. Protter
Exalted Contributor

Re: email subject

Shalom,

Here is a script that makes that easy. It also does attachments but you can comment that part of the code.

http://www.hpux.ws/?p=7

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
TTr
Honored Contributor

Re: email subject

Put something like the following in a script


po=`grep "PURCHASE_ORDER_NO:" filename | cut -d: -f 2`
acc=`grep "ACCOUNT#:" filename | cut -d: -f 2`
mailx -s "DS Purchase Order No: $po for Account Number $acc" email.address@domain.com < filename


PS. "I have assigned points to 0 of 37 responses to my questions"
http://forums11.itrc.hp.com/service/forums/helptips.do?#33
PK_1975
Frequent Advisor

Re: email subject

I have used the code as you suggested it working fine, but the PO NO and Account No. Repeating 2 times and also there is lot of space between them. Please check the format how it is displaying


DROP SHIP PO NO: ABCD ABCD for Acc#: 11111 11111

I want in this formate

DROP SHIP PO NO: ABCD for Acc#: 11111
VK2COT
Honored Contributor

Re: email subject

Hello,

TTr did well. There are no duplicates.
I am not sure who you mean by it.

Here is something similar to TTr's version,
without many blank spaces:

po=`awk '/PURCHASE_ORDER_NO:/ {print $2}' filename`
acc=`awk '/ACCOUNT#:/ {print $2}' filename`
mailx -s "DS Purchase Order No: $po for Account Number $acc" email.address@domain.com < filename

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Dennis Handly
Acclaimed Contributor

Re: email subject

>VK2COT: TTr did well. There are no duplicates.
I am not sure who you mean by it.

This would happen if filename had duplicates.
TTr
Honored Contributor

Re: email subject

> This would happen if filename had duplicates

That's right. This is the classic case of what happens when you are given a bad sample to work with and/or you are asked the wrong question.
VK2COT
Honored Contributor

Re: email subject

Seems the person who had raised the
question disappeared in thin air.

No replies, no words of thanks, and no
assigned points.

And his history does not look favourable:

"I have assigned points to 0 of 42 responses"

I was wondering if moderators of the
HP forums could or should put an
administrative lock on users who do not
follow the rules...

VK2COT
VK2COT - Dusan Baljevic
PK_1975
Frequent Advisor

Re: email subject

I am extremely sorry for that

MANY MANY MANY THANKS

I dont know how to assigned Point
could you please tell me
Patrick Wallek
Honored Contributor

Re: email subject

You've got to log in with your original id to start with, which is "pk1974".

Then you just to to your threads and select a point value from the drop down box above each response.

Then you just click "submit points" at the bottom of the thread.
Dennis Handly
Acclaimed Contributor