You need to send a letter to the owners of the site with the client's mail, when on the page with a subscription to news the client fills in the email field and presses the "subscribe to news" button.
In the mailers / subscribes_mailer.rb controller
class SubscribesMailer < ActionMailer::Base default from: "boss@yandex.ru", template_path: 'mailers/subscribes' def subscribe mail to: 'boss@yandex.ru', subject: "new subscribe" end end In the view where the submission form is located:
<section class="one-half"> <h2>Подписаться на новости</h2> <div id="newsletter-wrap"> <p>После подписки на новостную рассылку на ваш e-mail будут приходить все актуальные новости и акции компании. Вы в любой момент сможете отписаться от рассылки.</p> <div class="notification-box notification-box-success" style="display: none;"> <p>Вы успешно подписаны на новостную рассылку. Проверьте почтовый ящик для подтверждения.</p> <a href="#" class="notification-close notification-close-success">x</a> </div> <div class="notification-box notification-box-error" style="display: none;"> <p>Ваш почтовый ящик не может быть добавлен в список рассылки. Пожалуйста повторите запрос позже.</p> <a href="#" class="notification-close notification-close-error">x</a> </div> <form id="newsletter-form" class="content-form clearfix" action="#" method="post"> <%= button_to "Добавить", SubscribesMailer.subscribe, :class => 'button' %> <input id="newsletter" type="email" name="newsletter" placeholder="Введите свой e-mail адрес …" class="required"> </form> <p class="tip"><span class="note">*</span>Если письмо не приходит, проверьте папку спам в Вашем почтовом ящике.</p> </div> </section> When I refresh the page, I get the error:
undefined method `SubscribesMailer' for SubscribesMailer:Class Please tell me how to properly send a letter from the site.