开发者

Magento - custom form

开发者 https://www.devze.com 2023-02-13 02:35 出处:网络
I have a form, which at the moment is a simple HTML based one, that doesn\'t do anything. What I\'m looking to do though, is to be able to send an email once the form has been submitted and also save

I have a form, which at the moment is a simple HTML based one, that doesn't do anything.

What I'm looking to do though, is to be able to send an email once the form has been submitted and also save the data to the database.

The problem comes, with the email sending. In the form, there is a drop down menu. The menu items are items in my suppliers model/module, which have a name and email address.

So, when I select Supplier A, the form passes validation, it needs to send Supplier A an email and save the details (this shouldn't be too hard).

I'm just not sure how I'd get the email address.

Would I need to pass some kind of parameter to a custom sendEmail() method?

All help appreciated.

Thanks

UPDATE:

Ok, so before I do the email part, I'd like to store the data in the table, named test drive.

I've created the module in the admin and a form to submit data from on the frontend end.

But I cannot seem to get the data to insert.

All help is welcome

Th开发者_运维问答anks


For sending email see this Mage_Contacts_IndexController::postAction() action or Mage_Sales_Model_Order::sendNewOrderEmail()

If You created module with model, you can get instance of that model, insert data and then save it or You can create ResourceModel and then execute SQL.

0

精彩评论

暂无评论...
验证码 换一张
取 消