Using a decorator that is not based on email addresses?

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
afwt
Forum Newbie
Posts: 15
Joined: Fri Sep 21, 2007 2:53 pm

Using a decorator that is not based on email addresses?

Post by afwt »

Hi guys,

I need an advice on how to solve this problem I have. I have a list of over 10k subscribers, and I have "personalization tags" that I use. However, the problem is that I have a couple of family members using the same email address, so I literally have to send multiple emails to the same email address (I allow sending "duplicates", i don't ask for unique email in the system), but using different personalization values.

I tried a couple of things, but Swift uses an email as a base, and in my case, I would need to use some kind of a subscriber id.

Has anyone tried to do this yet? I would love to hear something about this before I start (if needed) changing the class.

Thank you in advance.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

One solution I can think of is running multiple batches of email addresses, with some logic towards having different family members going in different batches. This should eliminate having to worry about a hack to support duplicate emails.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

If you extend the Replacements class to provide your own implementation then you could return different results depending upon how many times that same email address has been requested. You'd have to make sure you order your results the same way when pulling out the batch and when fetching replacements though.

Unfortunately as far as Swift is concerned an email address is a unique identifier in a batch and logically that makes sense to the majority :)
Post Reply