我正在使用動作梅勒,並試圖包括一個鏈接。出於某種原因,HTML正在被轉義,而不是顯示鏈接,它顯示:Rails的actionmailer轉義HTML與link_to
<a href="http://localhost:3000/employer?task_review=true">here</a>
相反,它應該只顯示鏈接。這裏是Ruby:
<%= raw(link_to("here", employer_url(:task_review => 'true'))) %>
我也曾嘗試:
<%= link_to("here", employer_url(:task_review => 'true')).html_safe %>
和
<%= link_to("here", employer_url(:task_review => 'true')) %>
他們都不似乎工作。我已經看過其他類似問題的答案,他們都說要使用raw
或html_safe
,但都不起作用。有沒有人有任何想法?
確定電子郵件是以HTML格式發送的嗎?它可能是它以TEXT格式發送的嗎? –
我認爲它是以html格式。我如何檢查/更改它? – Philip7899
查看原始郵件(在Gmail中更多 - >顯示原始郵件)並查找「Content-Type:text/html; charset =「UTF-8」' –