Help needed with Gift Certificates, earn free T-Shirt

7 views
Skip to first unread message

digicase

unread,
Nov 6, 2009, 9:21:14 PM11/6/09
to Satchmo users
I am currently trying to implement Gift Certificates for a client
running a Satchmo installation.

AS I understand form this[1] thread, the signal to email the intended
recipient with their Gift Certificate hasn't been written yet.

Has this been added since the end of August? I couldn't find any
mention of it in the latest source code?

If anyone can help me to add this signal and the email template then
my client is happy to let you choose three awesome T-shirts from their
range at Last Exit to Nowhere.

Thanks for your time.

[1]: http://groups.google.com/group/satchmo-users/browse_thread/thread/cf176d43a2ed1df9/3d657840260354e8?lnk=gst&q=gift#3d657840260354e8

[2]: http://www.lastexittonowhere.com







Bob Waycott

unread,
Nov 7, 2009, 4:04:44 PM11/7/09
to satchm...@googlegroups.com
At what point are you wanting to send the Gift Certificate? 

I'd be happy to help if I can.

digicase

unread,
Nov 13, 2009, 12:29:05 AM11/13/09
to Satchmo users
Thanks Bob!

I will contact you asap and hopefully we can get this sorted. I think
the email to the gift certificate recipient should go out when the
transaction has been approved via a PayPal IPN call. I need to confirm
that though.

On Nov 8, 5:04 am, Bob Waycott <bobwayc...@gmail.com> wrote:
> At what point are you wanting to send the Gift Certificate?
>
> I'd be happy to help if I can.
>
> On Fri, Nov 6, 2009 at 9:21 PM, digicase <art...@studio-automatique.com>wrote:
>
>
>
>
>
> > I am currently trying to implement Gift Certificates for a client
> > running a Satchmo installation.
>
> > AS I understand form this[1] thread, the signal to email the intended
> > recipient with their Gift Certificate hasn't been written yet.
>
> > Has this been added since the end of August? I couldn't find any
> > mention of it in the latest source code?
>
> > If anyone can help me to add this signal and the email template then
> > my client is happy to let you choose three awesome T-shirts from their
> > range at Last Exit to Nowhere.
>
> > Thanks for your time.
>
> > [1]:
> >http://groups.google.com/group/satchmo-users/browse_thread/thread/cf1...
>
> > [2]:http://www.lastexittonowhere.com

lzantal

unread,
Nov 29, 2009, 2:51:18 PM11/29/09
to Satchmo users
Hi.

I need this exact functionality. Has it been developed yet and if so,
where is it available?
Thank you so much for your help.

lzantal

Bob Waycott

unread,
Nov 30, 2009, 2:43:48 AM11/30/09
to satchm...@googlegroups.com
I am finishing up the code on this. It's not difficult.

I'd be willing to contribute the code back to Satchmo (it's nothing more than a simple listener), but I'm not sure what kind of implementation is desired (you know, plain text email vs html email vs template-based email, etc.).


lzantal

unread,
Nov 30, 2009, 4:16:05 AM11/30/09
to Satchmo users
Hi,
I am very excited to hear that.
Looking forward to reading your code and learn more about signals.
Would you mind mined to email it to me when its ready? : )

thank you

lzantal

lzantal

unread,
Jan 7, 2010, 1:46:44 PM1/7/10
to Satchmo users
Hi Bob,

Have you had a chance to finish the code?
Would love to integrate it into my project.

Thank you

lzantal

Bob Waycott

unread,
Jan 7, 2010, 2:01:09 PM1/7/10
to satchm...@googlegroups.com
Izantal,

Here is the rough code that connects to the GiftCertificate.post_save() signal to fire off an email at creation. It is just a very simple and rudimentary listener.

*************

from django.conf import settings
from django.core.mail import send_mail
from django.db.models import signals
from payment.modules.giftcertificate.models import GiftCertificate

# Listener function to send email at GiftCertificate creation
def notify_gift_cert_owner(sender, instance, created, **kwargs):
    print "***GIFT CERTIFICATE LISTENER****"
    if created:
        # Here is where we send an email to instance.recipient_email
        recipient = instance.recipient_email
        buyer = '%s %s' % (instance.purchased_by.first_name, instance.purchased_by.last_name)
        subject = "New Gift Certificate for you."
        msg = "A Gift Certificate has been purchased for you at %s by %s in the amount of $%s.\r\nUse the following code when making purchases:\r\n%s" % (instance.site.name, buyer, instance.start_balance, instance.code)
        sender = settings.DEFAULT_FROM_EMAIL
        
        send_mail(subject, msg, sender, [recipient], fail_silently=False)
    else:
        pass

signals.post_save.connect(notify_gift_cert_owner, sender=GiftCertificate)


******************

--
You received this message because you are subscribed to the Google Groups "Satchmo users" group.
To post to this group, send email to satchm...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.




lzantal

unread,
Jan 7, 2010, 4:35:36 PM1/7/10
to Satchmo users
Hi Bob,

Thank you very much!
It does look simple although I have to admit I could not come up with
a working solution on my own without editing satchmo core.
Yet again I see a big need for me to learn signals even more. I did
not know I can use signals like that.

Thank you very much again

lzantal

> On Thu, Jan 7, 2010 at 1:46 PM, lzantal <lzan...@gmail.com> wrote:
> > Hi Bob,
>
> > On Nov 29 2009, 11:43 pm, Bob Waycott <bobwayc...@gmail.com> wrote:
> > > I am finishing up the code on this. It's not difficult.
>
> > > I'd be willing to contribute the code back to Satchmo (it's nothing more
> > > than a simple listener), but I'm not sure what kind of implementation is
> > > desired (you know, plain text email vs html email vs template-based
> > email,
> > > etc.).
> > Have you had a chance to finish the code?
> > Would love to integrate it into my project.
>
> > Thank you
>
> > lzantal
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Satchmo users" group.
> > To post to this group, send email to satchm...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > satchmo-user...@googlegroups.com<satchmo-users%2Bunsu...@googlegroups.com>

Bob Waycott

unread,
Jan 7, 2010, 6:04:32 PM1/7/10
to satchm...@googlegroups.com
No problem. You can extend it further than that to send out something better than a text email, but that shows you how to hook into the right spot at the right moment and take it from there.

Best,

Bob

To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages