Hi there,

In this page admin/store/settings/gift_certificates, we can change the body of the email which will be sent to gift certificate recipients. The only available variables are: !gift_certificate_message, !gift_certificate_value, !gift_certificate_value_integer, !gift_certificate_code, !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url. However, we don't have any variables for the names of purchasers of the gift certificates. Would you please tell me how to include them? Please help me because I am stuck and don't know how to solve this problem. Many many thanks.

Kit

Comments

franceslui’s picture

Would any one please help me out? I am helping a charity organization and need to have this feature done as soon as possible. I believe that it makes sense to have the name of the purchaser in the notification email. Otherwise, gift certificate recipients do not know who send them gift certificates.

If you have any idea how to modify the code in the module, would you please tell me how? Thank you in advance.

Kit

jenniferannwalsh’s picture

Kit,

Did you figure this out? I am thinking of using the gift certificate module to allow people to make a donation to a charity in someone else's name and then send an email to the recipient. We also need to include the name of the purchaser.

Jen

torgospizza’s picture

This would be a change we'd have to make to which tokens are available to the certificate message. Not a difficult task - I'll see if I can get this done soon. I'll connect with jrust as well to see if he has any updates to post.

jenniferannwalsh’s picture

That would be great. I ended up compromising and using their email address. As In "xx@00.cm has sent you....." Which works well enough. Full names are even nicer though!-)

Another thing I needed for that project was the ability to customize the image that went out with each email so that each gift certificate had a unique image associated with it. I managed to get this working in a total hack way: I made each gift certificate (ecard) a different price. I then used the !gift_certificate_value_integer to form a unique filename for each: src="http://shopforaperfectworld.org/sites/default/files/!gift_certificate_va..."
It ain't pretty but it worked.

The problem I am having now is that another non-profit I work with wants to have multiple ecards (gift certificates) that are all the same price but still use different images in the certificate email. I am trying to figure out how to create a unique category or token or ? for each of the ten cards that would allow me to do that. The image itself is uploaded to the gift cert node, if that helps anything.

I'm not sure how to go about that. I sense there may be something I could do with tokens and conditional actions but not sure where to start. I may need to get some pro help on this one but any pointers in the right direction would be appreciated. I guess it doesn't help that I am trying to use gift certificates as donation ecards rather than it's intended purpose but it's working great except for this one little puzzle.

Jen

jenniferannwalsh’s picture

I've been researching and thinking about this more. I tried Token Filter but that didn't work as the Gift Cert emails do not use Input Filters. I thought about making a Conditional Action to send the ecard/certificate email but quickly realized that there would be problems if someone were to order more than one card. So, I came back here and re-read Erik's post and now I think I get it. A change needs to be made to the module to make new tokens available for the gift certificate email. I looked in the module and see the place where this would go. My coding skills are minimal to non existent but I'm going to try anyway, on a test site of course. What I think would work for me is to add a variable for the product sku. Then I can use the sku variable in the link to the image, same way I used the value integer previously. There are probably better things to add here, like attributes, but I think sku will be easiest so that's what I'll try first. Any help greatly appreciated, potential for monetary appreciation especially if the results can be shared in this or related module so other non-profits can easily create donation ecards.

jenniferannwalsh’s picture

At least I can say I tried. I got my hopes up when I read that it was 'not a difficult task' but it is still too difficult for my minimal skills. Spent quite a few hours trying. I have a deadline so I have to give up for now and instead give each card/certificate a unique price (using variable price now) so I can use the value integer variable to name the images.

If anyone who's got the skills wants to take this on, let me know what kind of inducement you would want and I'll see if I can raise the $. Would love to get it going this week but still interested even if time has gone by.

EDIT: Forgot to add, the token I am hoping to get working now is to make the sku or model number available. I'm happy to include first name, last name as well since that is also a nice feature. I could use the product image as a variable if that makes more sense than the sku. That actually makes a lot more sense for my purposes, I just didn't know if it was possible or not.

Jen

torgospizza’s picture

Hmm, what's your deadline? Tokens are fairly easy to implement, I could probably give it a crack sometime this week. Money always helps, even if it's $100 or something, doesn't have to be a lot. I'm working on a fairly big project now (site for a magazine) so I don't have a ton of time to spend on other things, but I can always be convinced otherwise.

Let me know when you need it by. I'd rather you had something that works great than have to make a kludge like that.

jenniferannwalsh’s picture

Oh joy!

Well, I have to have the site up tonight as they are running some ads starting Thursday to promote the ecard donations for Valentine's Day. I know, I should have written this last week. Doh! But it would be okay to change it after launch. Not ideal but okay. We are going to be using this all year, V-Day is just the kick off.

I would be happy to contribute $100 to this. Whether it happens this week or not. I work with a lot of non-profits and once they see I've done this for one, they're all going to want it.

Here is my test site: http://cancerschmancer.dreamhosters.com/store/happy-valentines-day
(forgive any funky formatting on this site, it's my playground. live site is here: http://cancerschmancer.org/)

PM me for the login and I can send $ via PayPal whenever. Happy to pay up front. I've followed your posts since I started down this path so trust level is high :-).

jasonabc’s picture

Category: support » bug
Priority: Normal » Critical

did this ever get resolved? It's a really bad omission to not include the purchaser name and email in the email the recipient gets. How do they know who the gift certificate is from??!!!

torgospizza’s picture

No, it didn't - but I'm planning on rewriting this module from scratch and this will be one of the first features (either keeping the custom textfields idea or working CCK integration into it). I'm not sure which is best - thoughts?

EDIT - I think I can make this a quick fix in the meantime, though. Really, REALLY itching to rewrite this entire module. It's kind of a mess.

jrust’s picture

Status: Active » Fixed

I think it's fixed by the new token integration via #805954: Use tokens and theming system for email

torgospizza’s picture

Brilliant! Many thanks.

jasonabc’s picture

Version: 6.x-1.x-dev » 6.x-1.3
Status: Fixed » Active

Hi guys - I see token support has now been added - but there are still no tokens that add the purchaser's details (name? email?) to the recipient email.

All that is listed in the Gift Certificate replacement patterns for the purchaser is this:

[gift-cert-purchaser-id] The ID of the certificate purchaser.

Which is no use at all. I guess I can use the Ubercart order tokens ([order-first-name] and [order-last-name]) for orders that are put through the store - but what about gift certs created on the Admin side? Ubercart order tokens are no good in this scenario....

Any chance the purchaser first and last name and/or email could be added? Even with the updated module - the recipient still has no idea who purchased them a gift certificate.

thanks

Jason

jrust’s picture

Status: Active » Closed (won't fix)

Because the email is now a full PHP template you just need to add in some code to your email template to fetch the purchaser name. For stores that need to add a purchaser name, you can add a new Attribute that you include as part of your Gift Certificate product. Or you can base the purchaser name off the purchaser-id. There are any number of additional Attributes that can be added to a Gift Cert now that the email is themable and I don't think it makes sense to hard-code each of them in. If you really need it on the admin side as well you will need to implement hook_form_alter in a custom module.

bsorrells’s picture

I just wanted to chime in here in case someone else runs across the same thing. Like the users above, I needed to access a few attributes that were not native to the module's token support. I added several. When I tried to access the attributes, I realized they were in a serialized array. So, inside of the tpl.php file that I copied into my theme directory, I added the following at the top:

        $product_data = unserialize($order_product->data);
        $gift_cert_from = $product_data["attributes"]["Your Name"][0]);
torgospizza’s picture

Hmm, that doesn't seem right. I wonder if the token code isn't parsing values correctly? Seems the value being replaced by the token should be the value, not a serialized array...

cocofireah’s picture

I've been researching and thinking about this more.Thanks a lot about it!