Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

Coupon Code E-Mailer Popup
Sr. Member
Total Posts:  121
Joined:  2007-12-01

Soo, I guess the newsletters don’t work for some reason. At least, I couldn’t figure out how to get mine to send. I needed to offer coupons to my customers though, so I made a small PHP script and grabbed a couple java scripts to accomplish the task.

There’s three files here. The first is header_java. Open that, edit it to your liking, and put it in the header code of your template. This is what will be generating the popup window for the coupon page.

The second file is callout_java. This is the script that you will be putting in the body of your site, as a hyperlink for people to click on. The way it is formatted right now, it’s a hyperlink in the form of an image (like a coupon button). I put it in my right callout box, as it was easy to modify and always visible. It would work anywhere though.

The third file is the actual php script to generate the page and send the e-mails. Set up the configuration section and it should work just fine. It will pull the current active coupons from your database and send them in an e-mail to the entered address. There’s only one input, which is validated as an e-mail address, and a valid e-mail address.

I’m basically a newbie at this stuff, so if any experts see some kind of security vulnerability or other coding issue, please let me know. Any improvements would be greatly appreciated. I just made this for my own site, but figured some of you might get some use out of it as well.



Made a couple updates to coupon_form.php.

File Attachments
header_java.txt  (File Size: 1KB - Downloads: 239)
callout_java.txt  (File Size: 1KB - Downloads: 212)
coupon_form.php  (File Size: 4KB - Downloads: 264)
Magento Community Magento Community
Magento Community
Magento Community
Total Posts:  68
Joined:  2007-12-12

This guy knows his stuff. Thanks for sharing the info Brett!

Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top