I have a form with a text field where users can input multiple email addresses. The problem is, these email addresses are formatted in many different ways. For instance:
"Bob Smith" <bob@company.com>, joe@company.com, "John Doe"<john@company.com>
Right now, I separate them using:
emails = params[:invite][:invite_emails].split(', ')
emails.each do |email|
# send_email
end
How could I get all the emails even though they're formatted differently?