Sendmail: Problem with string.join
OK, what's wrong with this then? <dtml-let email_list=dbGetRumourInterest> <dtml-let followup_list=dbGetFollowups> <dtml-if email_list> <dtml-sendmail mailhost="MailHost"> To: <dtml-var expr="_.string.join(email_list,',')"> From: ozrail@bigpond.net.au etc... I found the string.join example in an email from Dieter, but when I try this I get an error: first argument must be a sequence of strings. When I run the SQL standalone, it returns what looks like a sequence of strings to me. Any clues out there? Steve
"Steve" == Steve Smith <ssmith6@bigpond.net.au> writes:
Steve> OK, what's wrong with this then? Steve> <dtml-let email_list=dbGetRumourInterest> <dtml-let Steve> followup_list=dbGetFollowups> <dtml-if email_list> Steve> <dtml-sendmail mailhost="MailHost"> To: <dtml-var Steve> expr="_.string.join(email_list,',')"> From: Steve> ozrail@bigpond.net.au etc... Steve> I found the string.join example in an email from Dieter, Steve> but when I try this I get an error: first argument must be Steve> a sequence of strings. Steve> When I run the SQL standalone, it returns what looks like a Steve> sequence of strings to me. Any clues out there? They are probably result objects, not strings. What is the column name? e.g., if it's 'email' try: To: <dtml-in email_list><dtml-var email><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> There are probably better (but more arcane) ways... -steve Steve> Steve Steve> _______________________________________________ Zope Steve> maillist - Zope@zope.org Steve> http://lists.zope.org/mailman/listinfo/zope ** No cross Steve> posts or HTML encoding! ** (Related lists - Steve> http://lists.zope.org/mailman/listinfo/zope-announce Steve> http://lists.zope.org/mailman/listinfo/zope-dev )
Hi, Does dbGetRumourInterest method/variable return a list of strings? It cannot fail if you use string.join with the first argument as a list. Bye, A.R.K
"Steve" == Steve Smith <ssmith6@bigpond.net.au> writes:
Steve> OK, what's wrong with this then?
Steve> <dtml-let email_list=dbGetRumourInterest> <dtml-let Steve> followup_list=dbGetFollowups> <dtml-if email_list> Steve> <dtml-sendmail mailhost="MailHost"> To: <dtml-var Steve> expr="_.string.join(email_list,',')"> From: Steve> ozrail@bigpond.net.au etc...
Steve> I found the string.join example in an email from Dieter, Steve> but when I try this I get an error: first argument must be Steve> a sequence of strings.
Steve> When I run the SQL standalone, it returns what looks like a Steve> sequence of strings to me. Any clues out there?
They are probably result objects, not strings.
What is the column name? e.g., if it's 'email' try:
To: <dtml-in email_list><dtml-var email><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
There are probably better (but more arcane) ways...
-steve
Steve> Steve
Steve> _______________________________________________ Zope Steve> maillist - Zope@zope.org Steve> http://lists.zope.org/mailman/listinfo/zope ** No cross Steve> posts or HTML encoding! ** (Related lists - Steve> http://lists.zope.org/mailman/listinfo/zope-announce Steve> http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
karthick ramanarayanan -
Steve Smith -
Steve Spicklemire