Programatically add new donor sans donation #6814
-
I am looking to programmatically add a couple of donors who have not yet donated. I believe I need this function create, is that the only one I need? Can I get a simple example of calling it from my own form? I can create the array, just not sure of the syntax of calling the function from my own snippet. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Yup you can use the Donor model to create a new one like this:
|
Beta Was this translation helpful? Give feedback.
-
I wasn't sure myself, so I did a quick dive to document it here, but I would recommend using the new Donor Model factory that @jonwaldstein mentions. It starts in the Give_Import_Donations, which triggers give_donation_import_callback, which calls give_save_import_donation_to_db, which finally calls creates a new donor. |
Beta Was this translation helpful? Give feedback.
Yup you can use the Donor model to create a new one like this: