2016-09-08 4 views
0

私は電子メールでマージコードの置換を実行するためにディクテーションを使用しています。notifcations電子メールはうまくいきますが、何らかの理由でurlがうまく構成されているにもかかわらず、urlへのクエリ文字列。電子メールの本文に設定されている場合、URLにクエリーストリングが付加されない

Dictionary<string, string> stringsToReplace = new Dictionary<string, string>(); 

stringsToReplace.Add("{method}", method); 
stringsToReplace.Add("{full_name}", fullname); 
stringsToReplace.Add("{ipaddress}", GetIPAddress()); 
stringsToReplace.Add("{query}", queryMessage); 
stringsToReplace.Add("{address}", address); 
stringsToReplace.Add("{user_name}", fullname); 
stringsToReplace.Add("{iva_ref}", caseRef); 
stringsToReplace.Add("{case_ref}", caseRef); 
stringsToReplace.Add("{optout}", OptionsText); 
stringsToReplace.Add("{regemail}", OptionsText); 

string linkreset = "<a href= '" + DomainUrl + "?email=" + customerEmail + "&uid=" + userId + "'> Reset Password" + "<a/>"; 
stringsToReplace.Add("{email}", customerEmail.ToString()); 

stringsToReplace.Add("{reset_link}", string.Format("Please click the link below to reset your password <br /> {0}", linkreset)); 

string verifyPassword = "<a href= '" + verificationUrl + "?email=" + customerEmail + "&uid=" + userId + "'> Verify Password" + "<a/>"; 

stringsToReplace.Add("{verification_link}", string.Format("Please click the link below to verify your password <br /> {0}", verificationUrl)); 

bodyMessage = bodyMessage.MultipleReplace(stringsToReplace); 

私はちょうど私がハイパーリンク

+0

地図のキーに{}を付ける必要がありますか? –

+0

こんにちは、他のマップはうまく働いているので、私はURLの引用符と何かを考えると{db}フィールドに保存されている事前に書かれた電子メールのテキストを解析するためにキーを使用しています – rogue39nin

+0

は、リンクリセットではいけませんか?どこにあなたが何かにverifyPasswordを追加しているのを見ることができません –

答えて

1

内のURLでその.aspxので停止していないクエリ文字列を見ると、私はあなたのコードに障害があると思う私のparamertersがverifyPasswordに至るまで持ち込まれていない理由cはいけません;

string verifyPassword = "<a href= '" + verificationUrl + "?email=" + customerEmail + "&uid=" + userId + "'> Verify Password" + "<a/>"; 

stringsToReplace.Add("{verification_link}", string.Format("Please click the link below to verify your password <br /> {0}", verificationUrl)); 

それは

string verifyPassword = "<a href= '" + verificationUrl + "?email=" + customerEmail + "&uid=" + userId + "'> Verify Password" + "<a/>"; 

stringsToReplace.Add("{verification_link}", string.Format("Please click the link below to verify your password <br /> {0}", verifyPassword)); 

ノートでなければなりませんように見える - verifyPasswordないvertificationUrl置き換えるインチ

+0

私は笑を得ることができませんどのように私はそれを逃すことができる – rogue39nin

+0

日の後半に感謝 – rogue39nin

関連する問題