Focal Point
[CLOSED] Request for new HOLD format EMAIL

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/923104174

June 21, 2010, 07:13 PM
Steve F
[CLOSED] Request for new HOLD format EMAIL
A couple ideas for new HOLD formats came up during one of the many 'hallway' meetings that always occur at Summit this year. The EMAIL idea is for something like this:

TABLE FILE DATA
PRINT SOMETHING
ON TABLE HOLD FORMAT EMAIL someone@somewhere
END

This doesn't offer a way to include the subject line or body information unless it could accept standard form 'mailto' syntax:

ON TABLE HOLD FORMAT EMAIL 'mailto:someone@somewhere?subject=Your Report&body=Short Message'

Of course the ampersand before the 'body' argument is problematic to Focus. Maybe the standard url encoding form would be required: %26 .

Or maybe with special heading types/attributes, i.e.:

TABLE FILE DATA
HEADING MAILTO
"someone@somewhere"
HEADING SUBJECT
"Your Latest Report"
HEADING BODY
"Multi Line Info"
"text text text"
PRINT SOMETHING
ON TABLE HOLD FORMAT EMAIL someone@somewhere
END

In case anybody is thinking of pointing out that Report Caster is designed to do this very thing, I'd like to point out that it actually does a different kind of job that this idea doesn't address. Report Caster runs autonomously to distribute data to a known recipient base on a regular schedule. The idea presented in this post wouldn't replace that. This idea would likely be used, in example, where a customer enters data on a web page to update a form which triggers an acknowledgment email. I don't believe Report Caster is able to provide that unless coded at the API level and even then I think it's overkill.

On another day, and if this topic gets much attention, I'll post the code we use here at UNT Health Science Center. We use WebFocus to prepare the email payload and then either copy a POP3 format file into a Microsoft IIS SMTP Server PICKUP directory, or use Perl NET::SMTP as an SMTP Client to deliver the email message to our email gateway.

This message has been edited. Last edited by: Kerry,
June 21, 2010, 07:22 PM
Waz
Steve, good idea, to have a chance of this to happen, you will have to put in an NFR (New Feature Request) with IBI.

Currently when we want to email, we have to create the mail under program control and call the OS to send it.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 21, 2010, 07:31 PM
Steve F
I want to make sure many people get to review the idea before a NFR is created. That way it stands a better chance of being useful and is clear to IBI development staff how and what to implement. And, more important, if this isn't something that many customers would actually use, then the way we are doing it now, and sharing how we do that, will save lots of development time that IBI can use for better things.
June 21, 2010, 07:49 PM
Waz
Good point.

For IBI to even consider making the change, they need to know its worth it, so the more people that put in the NFR the better.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 22, 2010, 05:36 AM
Tony A
As there is already the TITLE syntax within style sheets, my vote would be for that to be utilised as the subject line. That might have a little more success in an NFR that expanding the HEADING keyword to allow additional suffixes. I always get wary when syntax is extended to such degrees that it takes a few releases to iron out the "features".

On the whole though, a great idea.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
June 22, 2010, 06:41 AM
Dave
How about using the stylesheet to add the correct subject and/or body?

( like naming the worksheets in excel )

?


_____________________
WF: 8.0.0.9 > going 8.2.0.5
June 22, 2010, 02:36 PM
Darin Lee
Interesting and it would be very useful. The one problem I see is that this would REQUIRE mail services/server to be available on the same platform as the WebFOCUS server, which could be a restriction on several platforms. I don't really see an easy way around that one. I'm sure there's a more complicated one.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
June 22, 2010, 06:47 PM
Waz
Have you seen the EDAMAIL option in 7.7 ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 23, 2010, 03:02 PM
susannah
no, Waz.... what is the edamail option?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 23, 2010, 03:09 PM
Tom Flynn
Pretty Cool. From the New Features Doc:

  
Sending E-mail From a Procedure With File Content or an Attachment
E-mails can be sent from a procedure with the content of a specific file included in the body
of the email or as an attachment.
The syntax is:
EX EDAMAIL to, from, subject, [flag], filetype, data
where:
to
Is the e-mail recipient.
from
Is the e-mail sender.
subject
Is the e-mail subject.
flag
If flag is set to "a", the file is sent as an attachment. Otherwise, it is included in the
body of the e-mail.
filetype
Defines the data type, such as MASTER, FOCEXEC, HTML, and so on.
data
Is the data or [app/]filename with the mail content.



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
June 23, 2010, 03:27 PM
susannah
oh man! that rocks.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 23, 2010, 04:32 PM
Darin Lee
So I'm guessing that all of those can be replace with &vars and parameterize the whole line. Takes ReportCaster out of the picture for the easy stuff. -- Keeping my fingers crossed for that one.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
June 23, 2010, 05:47 PM
Waz
The real problem with the new features, is upgrading, we have been trying to two years.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 23, 2010, 06:36 PM
Darin Lee
Same here. It took about 3 years to finall get to 7.6.x from 7.1 and now 7.7 is there (with 8 on the horizon.) Just have to wait until there are enough of those must-haves to justify the migration to a new version.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
June 23, 2010, 06:46 PM
Waz
Ditto...

7.7 may have some nice things, but what will 8 have ?

To Upgrade or to wait, that is the question.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 23, 2010, 06:52 PM
njsden
Oh boy! And to think that we're still running on 5.3.4 Roll Eyes



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
June 23, 2010, 07:27 PM
Waz
OMG.....


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 24, 2010, 02:45 AM
Tony A
quote:
we're still running on 5.3.4
Alright, you don't have to make me jealous Wink New features are nice to have but sometimes the impact on performance and other "features" outweigh the advantages.

As for the EDAMAIL, nice extension of the product but I suppose that I'll have to wait a while. However, I have been using a similar method that I wrote using VB Script, primarily for Excel files that need compaction first but it would work for any file.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
June 24, 2010, 08:00 AM
trob
quote:
Originally posted by Waz:
Ditto...

7.7 may have some nice things, but what will 8 have ?

To Upgrade or to wait, that is the question.


I think 7.7 will have a smoother upgrade path to 8.


------------------------------------------
DevStudio 8.2.03
WFS 8.2.03
June 24, 2010, 08:06 AM
trob
Prior to 7.7 this is the solution I came up with. Seems like IBI has implemented about the same idea. Sendemail is a command line SMTP email client which supports Linux, BSD, OS X, Windows 98, Windows NT, Windows 2000, & Windows XP. SendEmail will allow you to attach files which you can attach reports or you can just send a link to a fex and the recipient can run the report.

-* File sendemail.fex
-SET &ECHO=ALL;

-* You can use these in your code if you have user setup
-* MR remote user - &IBIMR_user
-* WF remote user - &WF_REMOTE_USER

-DEFAULTS &FROMADDRESS = 'Webfocus <from@whatever.com>';
-DEFAULTS &TOADDRESS = 'Administrator <to@whatever.com>';
-DEFAULTS &REPLYADDRESS = 'Webfocus <reply@whatever.com>';
-DEFAULTS &CCADDRESS = '';
-DEFAULTS &BODY = 'Email Body Blank';
-DEFAULTS &SUBJECT = 'Email Subject Blank';
-DEFAULTS &MAILSERVER = 'server.whatever.com';
-DEFAULTS &REPORTFEX = 'PROD_BATCH_INQUIRY';
-DEFAULTS &PARM1 = 'PDBCH=';
-DEFAULTS &PARM1VAL = 'A558B09';

-SET &TOADDRESS = 'To <to@whatever.com>';
-SET &CCADDRESS = 'CC <CC@whatever.com>';
-SET &SUBJECT = 'Batch Information Review';
-SET &REPORTPARMS = IF &PARM1 NE '' THEN '&' || '&PARM1.EVAL' || '&PARM1VAL.EVAL' ELSE '';

-SET &BODY = '<html><body>The following batch needs your review.<p>' ||
-'<a href=http://wfserver:8080/ibi_apps/WFServlet?' ||
-'IBIF_webapp=/ibi_apps&' ||
-'IBIC_server=EDASERVE&' ||
-'IBIWF_msgviewer=OFF&' ||
-'IBIAPP_app=tiadev_tr&' ||
-'IBIF_ex=' || &REPORTFEX || &REPORTPARMS ||
-'>&PARM1VAL.EVAL</a></body></html>';

-SET &QT='"' ;
-SET &MAILFILE = 'F:\ibi\apps\tiadata\sendEmail.exe';
-SET &MAILCMD = '&MAILFILE.EVAL' |
-   ' -f ' | &QT || &FROMADDRESS || &QT |
-   ' -t ' | &QT || &TOADDRESS || &QT |
-   ' -u ' | &QT || &SUBJECT || &QT |
-   ' -m ' | &QT || '&BODY' || &QT |
-   ' -s ' | &MAILSERVER |
-   ' -cc ' | &QT || &CCADDRESS || &QT |
-   ' -o reply-to=' | &QT || &REPLYADDRESS || &QT;

-WINNT &MAILCMD.EVAL
-*-TYPE &MAILCMD.EVAL
-EXIT


Code above builds the following:
 F:\ibi\apps\tiadata\sendEmail.exe -f "Webfocus <from@whatever.com>" -t "To <to@whatever.com>" -u "Batch Information Review" -m "<html><body>The
following batch needs your review.<p><a href=http://wfserver:8080/ibi_apps/WFServlet?IBIF_webapp=/ibi_apps&IBIC_server=EDASERVE&IBIWF_msgviewer=OFF
&IBIAPP_app=tiadev_tr&IBIF_ex=PROD_BATCH_INQUIRY&PDBCH=A558B09>A558B09</a></body></html>" -s server.whatever.com -cc "CC <CC@whatever.com>"
 -o reply-to="Webfocus <reply@whatever.com>"
 

This message has been edited. Last edited by: trob,


------------------------------------------
DevStudio 8.2.03
WFS 8.2.03
June 24, 2010, 08:30 AM
FrankDutch
quote:
EDAMAIL



Edamail os already working in 7.6.x

We use it for example to update users automatical in case of reporting requests.

EX -lines 18 EDAMAIL &MAIL.EVAL; IBI@kempen.nl,
  ,
 IBI informationrequest &INFOSUBJECT.EVAL,
  ,
  ,
bla bla bla blaa:
&INFONAAM.EVAL
-------------------------------------------------------------------------
Reuest will be executed by: &MEDEWERKER.EVAL.
OldStatus: &OUDSTATUS.EVAL.
NewStatus: &NIEUWSTATUS.EVAL.
-------------------------------------------------------------------------
Remarks: &MAIL2INHOUD
-------------------------------------------------------------------------
&MAILDISCLAIMER
-------------------------------------------------------------------------
Greetings,
department IBI
ibi@kempen.nl
-*


As you can see some amper values in this message which will be filled by the preceding report.
The amper value &MAIL is the adress of the receveiver.

BTW we have found this in the documentation of ETL (Datamigrator) so I am not sure it can be used for everybody.
Not sure if an attachement can be sent within this option.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

June 24, 2010, 04:31 PM
Steve F
I just tried EDAMAIL on 7.6.11 and it basically works. Thanks to FrankDutch for the example. I wasn't able to make sense of the other command line options, i.e., FOCEXEC or MASTER. I wasn't able to reference an external file of any kind to be sent as the body or as an attachment. I haven't found any explanation on how to use EDAMAIL in the manuals. In all cases, leaving the filetype blank caused the last argument to become the body of the email. All other variations I tried resulted in an email with an empty body and no attachment. It's a start and looks like this is a solution to my first post. It's more flexible than my idea, and in the form that works, allows me to generate an email for a variety of different reporting conditions.

I did need to set up SMTP_HOST on the WebFocus Server, Web Console, Workspace Configuration, General, E-Mail setting to point to my SMTP gateway. As Darin mentioned, there needs to be an SMTP server, but not necessarily on the same box. In every instance of being able to email from a Focus procedure, or any other language procedure, PHP, Perl, C, etc., there needs to be a SMTP server available. This can be your organizations SMTP gateway, your ISP's outgoing mail server, or a localhost SMTP server. You should be careful setting up a localhost that you don't become a spam relay. It's much better to use an already available SMTP gateway (in this text, I use the word gateway to mean an SMTP server that recognizes my WebFocus server's IP address as authorized to relay mail, or one that I have a login username and password for. An SMTP server is just the application that knows how to look up MX records and connect to other SMTP servers to relay mail.).

This message has been edited. Last edited by: Steve F,
June 24, 2010, 04:36 PM
FrankDutch
Steve

you can send an attachement, but I never tried that.
look at the first line in the code....it says "lines 18" and that is a variable number.
the number of lines followed need to match that number
I did not find any documentation so far, but it works




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7