クラス ライブラリで ActionMailer.Net.Standalone パッケージを使用しています。プロジェクトのルートには、"Templates" というフォルダーがあり、そこにファイル OrderConfirmation.html.cshtml があります。
このような:
これが私のメーラークラスです:
public class Mailer : RazorMailerBase, IMailer
{
public RazorEmailResult OrderConfirmation(string toAddress, Order order)
{
To.Add(toAddress);
From = "foo@bar.com";
Subject = "Account Verification";
return Email("OrderConfirmation", order);
}
public override string ViewPath
{
get { return "Templates"; }
}
}
プロジェクトを実行すると、次のエラーが表示されます
"Could not find any CSHTML or VBHTML views named [OrderConfirmation] in the path [Templates]. Ensure that you specify the format in the file name (ie: OrderConfirmation.txt.cshtml or OrderConfirmation.html.cshtml)"
パスが間違っていると思います。どのパスを使用すればよいですか?
ありがとう。