Watt
Watt

Reputation: 3164

How to send email using mail.php on an app running on RoR

I am trying to integrate one of my web developer's work into the existing Ruby on Rails app.

The developer wrote a function in public/mails.php which get called when a user clicks send feedback on the public/index.html page. (He doesn't know RoR.)

Here is html snippet.

<form id="feedbackForm" method='post' action='mail.php' name="feedbackForm">

The problem is: This feedback email sent fine when the app is running on a php enabled server. But, expectedly, it doesn't work when I run the app on my rails server.

I am hoping there must be some quick solution to enable this php specific functionality in Rails server.

Maybe by installing some extra gem through app/Gemfile?

Let me know if you like to see mail.php code too. And, if you need more details to understand my problem. The entire app is a RoR app.

The app is hosted on Heroku.

I am new to Ruby on Rails too.

Upvotes: 0

Views: 193

Answers (1)

fullybaked
fullybaked

Reputation: 4127

To be honest your best bet is to read up on the RoR mailer tools and rewrite your functionality. Having parts of your RoR app in PHP is not going to end well

You can find out more about RoR mailers here (and its pretty easy to get one running)

http://guides.rubyonrails.org/action_mailer_basics.html

PHP isn't a gem. While Heroku supports it, I don't know if they support both Rails and PHP on the same dynamo's so it may be impossible to do what you want.

Update: A little further digging and no, Heroku doesn't support both PHP and Rails on the same instance.

Upvotes: 2

Related Questions