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" <[email protected]>, [email protected], "John Doe"<[email protected]>
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?