-2

I have magento commerce, and I am creating in html an automatic e-mail that is going to be sent when someone signs up (in Dreamweaver).

In the HTML code I have a button that is about subscribing in our newsletter. What is the code that I have to link to this image, so if someone clicks on it he will subscribe to the newsletter.

Thanks in advance, Frank

1 Answers1

1

The call goes to:

http://yourdomain.de/index.php/newsletter/subscriber/new/  

But form data is sent via post as you can see in the Mage_Newsletter_SubscriberController newAction, where you find the following line of code.

  $this->getRequest()->isPost() && $this->getRequest()->getPost('email')

So you need to name your form field 'email'

Good luck!

Edit:

Just use something like this:

<form action="http://yourdomain.com/index.php/newsletter/subscriber/new/" method="POST" id="newsletter-validate-detail">
<input type="text" class="input-text required-entry validate-email" name="email" id="newsletter">
<input type="image" src="path to image" name="submit" />
</form>
Michael Leiss
  • 5,395
  • 3
  • 21
  • 27
  • so "href" equals with what? I am sorry I am new to codding. Shall I use href="$this->getRequest()->isPost() && $this->getRequest()->getPost('email')" ? – Fragkiskos Mysirlakis Jun 28 '13 at 16:53
  • My Code is: icon button So what do I need to alter, Thank you for your valuable time – Fragkiskos Mysirlakis Jun 28 '13 at 17:10
  • Sorry mate, this goes way to far. So i give you hints what to do: 1. learn how to create a form 2. submit action is in my initial answer 3. learn how to submit a form and then use the – Michael Leiss Jun 28 '13 at 17:18
  • I am not sure if you understand> I do not want a box that someone fills his e-mail address. If someone press the button I want to immdediatly grab his e-mail and sent it to magento for subscription. (I do not want in his e-mail to type again his e-mail) Anyway thank you for your time, I will try to find a solution somehow... – Fragkiskos Mysirlakis Jun 28 '13 at 17:58
  • i think i got you now. do you want to edit the newsletter subscription email template? – Michael Leiss Jun 28 '13 at 20:08
  • I am sorry for not being clear. And trully thank you for your interest. Please go to http://komvosagora.gr/ex.html, this is an HTML e-mail (a transactional e-mail based on"New account"e-mail. At the bottom you will see three columns the middle one which has an ice-cream, has an orange button as well, under it there are some words like:"Subscribe to be the first one that you are going to learn the best prices of the market."If he wants to subscribe then he presses the orange button, and then, I need the html code to grab his e-mail and send it to magento.Hope I said it right this time! – Fragkiskos Mysirlakis Jun 29 '13 at 08:44
  • you would need a form inside your newsletter template. but mailclients behave differently, so this is not a good idea: `http://css-tricks.com/html-forms-in-html-emails/` – Michael Leiss Jun 29 '13 at 09:24