Read the article about alias_method_chain
again, until you really get it. That is indeed what triggers process_with_mailer
every time process
is called.
By commenting out process_with_mailer
and alias_method_chain
, you essentially broke this code as it will never trigger again.
The reason that emails are now being sent, is because the mailer extension can be set up in two ways;
- if
Radiant::Config['mailer.post_to_page?']
istrue
, mailer forms will post to the current url. E.g. it will POST to domain.tld/contact, then Radiant finds the page at that path, and processes it. Thanks to thealias_method_chain
, it will find out if the form has just been posted, and then do it's thing to actually send the mail. - if
Radiant::Config['mailer.post_to_page?']
is not true (or not set), the contact form will POST to something like domain.tld/pages/:id/mail. That request is not handled by Radiant's SiteController, but by the MailController, which does not use process_with_mailer. The second is apparently your case, as you say that emails are properly sent now after commenting out thealias_method_chain
.
Exactly what caused the SystemStackError is hard to say without a more complete error message, but: judging from something you pasted (activesupport-2.3.18), you are trying to use this extension with radiant 1.1.3, while it has not been updated in 4 years.. Do you actually use the recaptcha functionality? If not, I'd say drop this fork and use the 'normal' mailer extension that it is based on: https://github.com/radiant/radiant-mailer-extension