bvstone

How we use MAILTOOL and G4G for software keys and reminders

Posted:

How we use MAILTOOL and G4G for software keys and reminders

Our software normally comes about because of a specific need we have.  There couldn't be a better example of this than our MAILTOOL and G4G software.

For years we've been using GMail as the mail server for our company.  It's worked pretty much flawlessly.  The only issue we had was to send emails from our IBM i (AS/400) we needed to enable SSL/TLS and authentication in our mail software.  That's where MAILTOOL Plus came about.

When a customer downloads software and/or requests a trial key for our software, our website (www.bvstools.com) which runs on an IBM i will automatically email a 30 day trial key to that customer.

In the past we would go through these emails and manually send reminders to the customer a few days later asking how things were going with the trial, and to let them know that they are more than welcome to request another 30 day key.  We work in the IT field too and know that sometimes you get taken off a project and put on another.

Now, sending all these emails out took a lot of our time, especially with how many key requests we get in a day.  So, we though why not create something that will automatically send the reminder emails.  And that's where the Google Calendar addon for G4G came to be.

Now when a customer requests a key, we add an entry to a specific Google Calendar that is just for key requests 15 days from the date that the request was made.  Here's a snippet of that source code:

CalDate = %date() + %days(15);                                       
CalTime = %time();                                                   
                                                                     
rc = #g4gcal_setValue('id':'bvstone@bvstools.com');                  
rc = #g4gcal_setValue('calendar_id':'mycalendarid');                          
rc = #g4gcal_setValue('event_title':%trimr(WPEmail) + ' - ' + %trimr(WPSoftware));   
rc = #g4gcal_setValue('start_date':%char(CalDate:*USA0));            
rc = #g4gcal_setValue('start_time':%char(CalTime:*HMS0));            
rc = #g4gcal_setValue('end_date':%char(CalDate:*USA0));              
rc = #g4gcal_setValue('end_time':%char(CalTime:*HMS0));              
rc = #g4gcal_setValue('event_key':WPEmail);                          
rc = #g4gcal_setValue('event_description':WPSoftware); 
rc = #g4gcal_addEvent(eventID);
               

Every morning (via a job scheduled entry) our IBM i requests the calendar events for that day.  If it finds one, it knows to send an email and to which user.

PGM                                                     
DCL        VAR(&DATE6) TYPE(*CHAR) LEN(6)               
DCL        VAR(&DATE8) TYPE(*CHAR) LEN(8)               
                                                        
RTVSYSVAL  SYSVAL(QDATE) RTNVAR(&DATE6)  
               
CVTDAT     DATE(&DATE6) TOVAR(&DATE8) TOFMT(*MDYY) +    
             TOSEP(*NONE)                               
G4GLSTEVT  ID(bvstone@bvstools.com) +                 
             CALID(mycalid) +   
             FROMDATE(&DATE8) TODATE(&DATE8) +        
             EVTOPT(*REPLACE)                         
                                                      
CALL       PGM(AUTOEML)                               
                                                      
ENDPGM                                                

 

      /free
       // create the email body using eRPG SDK here

       Subject = 'Software Evaluation Followup from BVSTools.com';


       if (#mailtool_init() >= 0);
         rc = #mailtool_setValue('configuration_file':
                '/bvstools/bvstools_mailtool.json');
         rc = #mailtool_loadDefaults();
         rc = #mailtool_addTORecipient(Email);
         rc = #mailtool_setValue('subject':Subject);
         rc = #mailtool_setValue('message':'*ATT');
         rc = #mailtool_addAttachment(tempout);
         rc = #mailtool_sendMail(errMsg);
       endif;

To make the code more readable, we've cut out a lot.  First the CL retrieves all the calendar entries for that day.  Those entries are placed into a physical file which the RPG program that is called reads through.  For each entry it will send an email.  But, because each email is unique to a user who downloaded software that means the name, email address and software downloaded is all different.

This means we want to create the body of the email as a stream file.  We use our eRPG SDK to do this.  This part is commented out in the source shown above, but what it basically does is create a nicely formatted email specific to the user and the software (or multiple pieces of software) that was downloaded.  

Finally, MAILTOOL is used to send the email.

So as you can see, incorporating software such as G4G can really save you a lot of time by automating jobs that you otherwise would be spending a lot of manual time on.


Last edited 06/09/2015 at 15:26:14



Latest Posts:

How to Whitelist GreenTools for G Suite (G4G) For Your Organization How to Whitelist GreenTools for G Suite (G4G) For Your Organization
Posted by November 5, 2023
BVSTools >> BVSTools Software Discussion >> GreenTools for G Suite (Google Apps) (G4G) Specific Discussion
QuickBooks Online Releases QuickBooks Online Releases "New Invoices!"... and It's Terrible!
Posted by October 8, 2023
QuickBooks >> QuickBooks Online
Admin/4i - What is it? Admin/4i - What is it?
Posted by September 30, 2023
Vendor Corner >> MSD Information Technology
BVSTools Releases Send Job Log to BVSTools (SNDLOG2BVS) Command BVSTools Releases Send Job Log to BVSTools (SNDLOG2BVS) Command
Posted by August 28, 2023
BVSTools >> BVSTools Announcements
MAILTOOL Now Allows Email Redirection for Development and Testing MAILTOOL Now Allows Email Redirection for Development and Testing
Posted by May 27, 2023
BVSTools >> BVSTools Announcements >> eMail Tool (MAILTOOL) Specific Announcements
GreenTools for Microsoft Apps (G4MS) Now Supports Footers When Sending Email GreenTools for Microsoft Apps (G4MS) Now Supports Footers When Sending Email
Posted by March 29, 2023
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
QuickBooks Online - Subtotals and Discounts Frustration QuickBooks Online - Subtotals and Discounts Frustration
Posted by March 16, 2023
QuickBooks >> QuickBooks Online
Making the Switch From QuickBooks Desktop to QuickBooks Online - No Picnic Making the Switch From QuickBooks Desktop to QuickBooks Online - No Picnic
Posted by March 16, 2023
QuickBooks >> QuickBooks Online
BVSTools Software Verified on V7R5 and Power10 BVSTools Software Verified on V7R5 and Power10
Posted by December 9, 2022
BVSTools >> BVSTools Announcements
Microsoft Office 365 Servers and Random Errors Issue Microsoft Office 365 Servers and Random Errors Issue
Posted by November 14, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Sending/Resending Emails Using a MIME File with MAILTOOL Sending/Resending Emails Using a MIME File with MAILTOOL
Posted by November 8, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Sending an HTML Email on Your IBM i Using MAILTOOL Sending an HTML Email on Your IBM i Using MAILTOOL
Posted by November 1, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Transferring License Keys from One System to Another Transferring License Keys from One System to Another
Posted by October 31, 2022
BVSTools >> BVSTools Software Discussion
Calculating the Size of a File Before Base64 Encoding Calculating the Size of a File Before Base64 Encoding
Posted by August 13, 2022
Programming >> RPG Programming
GreenTools for Microsoft Apps (G4MS) v9.12 Now Includes Function to Send Emails using MIME File GreenTools for Microsoft Apps (G4MS) v9.12 Now Includes Function to Send Emails using MIME File
Posted by August 11, 2022
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements

Reply




Copyright 1983-2020 BVSTools
GreenBoard(v3) Powered by the eRPG SDK, MAILTOOL Plus!, GreenTools for Google Apps, jQuery, jQuery UI, BlockUI, CKEditor and running on the IBM i (AKA AS/400, iSeries, System i).