CINXE.COM
LISTSERV at Work - Issue 1, 2005 (American Edition)
<html> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("http://web.archive.org/web"); __wm.wombat("https://lsoft.com/news/techtipMAE-issue1-2005-us.asp","20240305132405","http://web.archive.org/","web","/_static/", "1709645045"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <title>LISTSERV at Work - Issue 1, 2005 (American Edition)</title> <style type="text/css"> <!-- p.statement { font-family: verdana, arial, helvetica, sans-serif; font-size:11px; color: #000000; text-align: center } p.statement A { font-family: verdana, arial, helvetica, sans-serif; font-size:11px; color: #cc6600; text-align: center; text-decoration: none } p.head { font-family: verdana, arial, helvetica, sans-serif; font-size:14px; font-weight:bold; color: #000000 } p.head A { font-family: verdana, arial, helvetica, sans-serif; font-size:14px; font-weight:bold; color: #000000; text-decoration: none } p.body { font-family: verdana, arial, helvetica, sans-serif; font-size:13px; color: #000000 } p.body A { font-family: verdana, arial, helvetica, sans-serif; font-size:13px; font-weight:bold; color: #cc6600; text-decoration: none } p.link { font-family: arial, helvetica, sans-serif; font-size:11px; color: #000000; font-weight:bold; text-align:right } p.link A { font-family: arial, helvetica, sans-serif; font-size:11px; color: #CC6600; font-weight:bold; text-align:right; text-decoration: none } p.quote { font-family: verdana, arial, helvetica, sans-serif; font-size:13px; color: #000000; text-align: center } p.quote A { font-family: verdana, arial, helvetica, sans-serif; font-size:13px; font-weight:bold; color: #cc6600; text-align: center; text-decoration: none } p.quoteby { font-family: verdana, arial, helvetica, sans-serif; font-size:13px; color: #6699CC; font-weight:bold } p.quoteby A { font-family: verdana, arial, helvetica, sans-serif; font-size:13px; color: #6699CC; font-weight:bold; text-decoration: none } --> </style> </head> <body> <table width="620" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #CC6600"> <tr> <td><a href="issue1-2005-us.asp"><img src="/web/20240305132405im_/https://lsoft.com/news/issue1-2005/header-us.jpg" alt="LISTSERV at Work" border="0"></a></td> </tr> <tr> <td><a href="n-about.asp"><img src="/web/20240305132405im_/https://lsoft.com/news/issue1-2005/about.gif" alt="About" border="0"></a><a href="n-subscribe.asp"><img src="/web/20240305132405im_/https://lsoft.com/news/issue1-2005/subscription.gif" alt="Subscription" border="0"></a><a href="n-archives.asp"><img src="/web/20240305132405im_/https://lsoft.com/news/issue1-2005/archives.gif" alt="Archives" border="0"></a><a href="n-contact.asp"><img src="/web/20240305132405im_/https://lsoft.com/news/issue1-2005/contact.gif" alt="Contact Us" border="0"></a></td> </tr> <tr> <td bgcolor="#ffffff"> <table width="100%" cellpadding="10" cellspacing="0" border="0"> <tr> <td valign="top"> <p class="head">Tech Tip (LISTSERV Maestro) – Issue 1 – 2005</p> <p class="body"><b>Q. How can I send members of my data warehouse Happy Birthday Greetings on their actual birthdays?</b></p> <p class="body"><b>Answer by Johannes Hubert<br/>Senior Applications Programmer<br/>L-Soft</b></p> <p class="body">Follow the steps below to create a birthday greeting using a hosted recipient list and target group in LISTSERV Maestro 2.0.</p> <p class="body">1. Create a hosted recipient list with the profile fields you require, including one field for birthday. For this example, the field is called "DOB".</p> <p class="body">2. Set the input validation for that field DOB so that it is validated as a "Date", for example in the American format "MM/dd/yyyy".</p> <p class="body">3. Proceed with creating your list and add subscribers to it, taking care to input the birthday in the correct format.</p> <p class="body">4. Create a target group based on this recipient list where in the condition tree you add a condition that compares two "formulas" with each other, using the "equals (=)" comparison. The formulas are:</p> <p class="body">Formula 1: <tt>Substring(&DOB;, 0, 5)</tt></p> <p class="body">Formula 2: <tt>ToDate(CurrentMillis, "MM/dd")</tt></p> <p align="center"><img src="/web/20240305132405im_/https://lsoft.com/news/issue1-2005/techtip-mae1.gif" alt=""></p> <p class="body">The formula tree will look something like this:</p> <p align="center"><img src="/web/20240305132405im_/https://lsoft.com/news/issue1-2005/techtip-mae2.gif" alt=""></p> <p class="body">5. Create a job with recipients based on this target group.</p> <p class="body">6. In the job, define content, with drop-ins enabled, like this:</p> <p class="body"><tt>Happy Birthday &fname;!<br/><br/>We wish you all the best on your birthday. Being {{*Calc ToNum(ToDate(CurrentMillis, "yyyy")) - ToNum(Substring(&DOB;, 6))}} years old is an occasion to celebrate!<br/><br/>Sincerely,<br/><br/>{{company_name}}</tt></p> <p class="body">7. Define the job to be "recurring" with a delivery time of, for example, 8 a.m and a delivery interval of 1 day, so that the job is sent out every day.</p> <p class="body">Every day the job will go to exactly those recipients who have a birthday on that day, with a nice message telling the recipient his/her age. If there are no matching records for a given day, the job for that day will be marked as failed, but the recurring job will still be rescheduled for the following day, targeted to only those recipients who have a birthday on that day.</p> <p class="body"><b>How does this work?</b></p> <p class="body">The condition that defines to which recipients the mail is sent says that only those recipients will be included where the following is true:</p> <p class="body"><tt>Substring(&DOB;, 0, 5) = ToDate(CurrentMillis, "MM/dd")</tt></p> <p class="body"><tt>"Substring(&DOB;, 0, 5)"</tt> extracts a substring from the value of the text <tt>&DOB;</tt> that starts at position "0" and ends at position "5 - 1", up to position "4" meaning the first five characters are retrieved.</p> <p class="body">Since the merged field <tt>&DOB;</tt> contains birthday dates that are of the form "MM/dd/yyyy", the first five characters are exactly the part "MM/dd" of each recipient's birthday.</p> <p class="body"><tt>"ToDate(CurrentMillis, "MM/dd")"</tt> formats the current time into a text string using the format pattern "MM/dd", the result of which will also be five characters with the current month (two digits) , a "/", and then the current day (two digits).</p> <p class="body">So if we compare the two strings returned by each formula with the equal comparison "=", the result will be true if both are the same. This means that if the month/day component of the birthday of the recipient is the same as the month/day component of the current date, we catch exactly those recipients who have their birthday that day.</p> <p class="body">To make the message more personalized, we also want to merge the current age of each recipient into the content. We do this by using a <tt>{{*Calc}}</tt> system drop-in with the following formula:</p> <p class="body"><tt>ToNum(ToDate(CurrentMillis, "yyyy")) - ToNum(Substring(&DOB;, 6))</tt></p> <p class="body"><b>What does this formula do?</b></p> <p class="body"><tt>"ToDate(CurrentMillis, "yyyy")"</tt> returns the current date, formatted with the pattern "yyyy" so it returns the year of the current date as four digits.</p> <p class="body">The <tt>"ToNum(...)"</tt> around this simply converts the text string containing the four year digits into a number.</p> <p class="body"><tt>"Substring(&DOB;, 6)"</tt> extracts a substring from the text string in &DOB; that starts at the character position "6" and extends to the end of the string. Since &DOB; contains the birthday of the current recipient always in the format "MM/dd/yyyy", the character at position "6" is the first "y" of the four-digit year number (which is the seventh character in the string, but character positions are zero-based, therefore the seventh character has the index "6").</p> <p class="body">This <tt>"Substring"</tt> extracts exactly the four year digits from the birthday of the recipient. The surrounding <tt>"ToNum(...)"</tt> then again converts this text string containing the four year digits into a number. The only thing remaining is to subtract the two number results from the two <tt>"ToNum(...)"</tt> functions from each other to get the difference between the current year and the birth year of the subscriber – the age of the subscriber.</p> </td> </tr> </table> </td> </tr> <tr> <td><a href="/web/20240305132405/https://lsoft.com/"><img src="/web/20240305132405im_/https://lsoft.com/news/issue1-2005/footer-us.jpg" alt="Copyright 2005 L-Soft" border="0"></a></td> </tr> </table> <script async src="http://web.archive.org/web/20240305132405js_/https://www.googletagmanager.com/gtag/js?id=UA-3167554-2"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-3167554-2'); </script> </body> </html><!-- FILE ARCHIVED ON 13:24:05 Mar 05, 2024 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 23:41:52 Nov 28, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.622 exclusion.robots: 0.031 exclusion.robots.policy: 0.018 esindex: 0.01 cdx.remote: 11.791 LoadShardBlock: 1017.011 (3) PetaboxLoader3.datanode: 847.152 (4) PetaboxLoader3.resolve: 326.028 (2) load_resource: 215.201 -->