I'm integrating a custom module with the ecard module. I don't want to use the standard form, and have instead created my own. As a result I wanted there to be a 'ecard_send_card()' function which I could call with all the necessary information and the card(s) would be sent. Currently all of this code logic resides in the submit handler for the standard form. I've split it out into its own function so now I can avail of the same functionality via a handy api call.
Cheers,
Stella
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ecard_api-608684-D6-v02.patch | 5.87 KB | kars-t |
| #1 | ecard_api.patch | 5.41 KB | stella |
| ecard_api.patch | 5.12 KB | stella |
Comments
Comment #1
stella commentedoops spotted a mistake when notifications are disabled. Fixed now.
Comment #2
kars-t commentedThis gives me a PHP Notice and I can't understand why you do this and where $node comes from?
I reworked the patch a bit. Biggest change is that I removed the random handling to make it a bit faster and uncomplicated. The version to generate MD5 hashes till you find one not in the database is very secure. But as there is no transaction active not 100% secure. So hashing microtime with some salt should be fair enough.
Please take a look at it so we can submit this :)
I'm on crack. Are you, too?
Comment #3
stella commentedHmmm looks like that line was in the original
ecard_form_submit(). I don't see any need for it, so it can probably be removed alright. The new patch looks good, especially the new random key generation.Comment #4
kars-t commented#608684 by stella, Kars-T: Added split sending of ecards into an API call.
Commited.