Promo Code distribution

I am trying to implement the promo code system. Where I can refer a friend and both will get a discount. I kind of know what to do. I have a created a promo code table. Now i need to find a way to distribute a promo code. I was thinking about sending an email. But the problem is the user need to be loggin first .

Once the firsdt user purchase the item it will use the existing promo code and append the user id to a promo-code and in this case I will know who send the promo code.

Please advice what would be best approach to distribute the promo code in a best manner.
LVL 19
erikTsomikSystem Architect, CF programmer Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

erikTsomikSystem Architect, CF programmer Author Commented:
Are there any suggestions
You've got the right idea. You don't really need the user to be logged in if they provide a valid email address that they will use -when- they login or register

Select link to send promo code
Enter user1 Email address, user2 email address
Submit form
Save u1 & u2 emails in table each to its own row with promo code. May want an identifier to indicate whether row is referral or referr-ee for referral success tracking. Also include a promo code usedYN field if the promo code is one time use. May also want to add datetime if referrals can expire (also for tracking)
cfmail promo code to u1 with easily cut and pastable or forwardable text for u1 to send to u2
don't send promo code to u2 ( u1 needs to do this otherwise it's not a referral, just spam)
When promo codes are used, look up email vs promo code in referral table and update to add time when used if required as well as usedYN field.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
erikTsomikSystem Architect, CF programmer Author Commented:
I only have 1 dilemma such as when the first person buys it they do not get the chance to provide a promo code. I will put this person into the lookup table with the promo code i generate for his/her friends. Once the user pass his/her promo to a friend and use it I will mark this code as used (from business logic it can be reused many times by different people,but only once by the same person) and generate the code for them so they can pass it to their friends.

How would I build the database at this point. because the promo code I want to use not just for referral I want to use it in regular bases   as well
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Since promo codes can be anything and you can have as many as you like, I'd think about having a specific one for referrals if for no other reason than it is easier to track if your referral program is effective.
erikTsomikSystem Architect, CF programmer Author Commented:
Do you think creating a type of promotion on the promoCode table is a good Idea. (Referral program or just promotional code ). Something like that
Yes. Having the ability to specify unique promo types can be quite useful, even if you don't use it right away.  Allows ofr lots of flexibility and reporting options.
erikTsomikSystem Architect, CF programmer Author Commented:
How would I say which promo to use. I have decided to create a generic promos. By using a  referral program I need a way to figured out where is this promo code is came from so I said I just add an id to the end of the code.

The dilemma is how to know which generic code to use,because I may end up with many
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.