2014-01-16 78 views
0

我想使用Meteor應用程序中的帳戶入口包,但忘記密碼不起作用。我不知道忘記的密碼是僅在生產環境中運行還是在開發環境中運行。在這裏,我的模板和賬戶項的CoffeeScript的代碼:忘記密碼與帳戶輸入(流星)

<template name='entryForgotPassword'> 
    <div class="small-12 columns accounts-page"> 
     <h2 class="page-titles">Forgot your Password?</h2> 
     {{#if error}} 
      <div class='alert'>{{error}}</div> 
     {{/if}} 
     <form id='forgotPassword'> 
      <input type="email" name="forgottenEmail" placeholder="Email address" value=''> 
      <button type="submit" class="button">Email Reset Link</button> 
     </form> 
    </div> 
</template> 



Template.entryForgotPassword.helpers 
    error: -> Session.get('entryError') 

    logo: -> 
     Meteor.call('entryLogo') 

Template.entryForgotPassword.events 
     'submit #forgotPassword': (event) -> 
      event.preventDefault() 
      Session.set('email', $('input[type="email"]').val()) 

     if Session.get('email').length is 0 
     Session.set('entryError', 'Email is required') 
     return 

      Accounts.forgotPassword({ 
       email: Session.get('email') 
      }, (error)-> 
     if error 
      Session.set('entryError', error.reason) 
     else 
      Router.go AccountsEntry.settings.homeRoute 
    ) 

我點擊提交按鈕,但我沒有收到電子郵件。

服務器控制檯打印這樣的:提前

I20140116-19:51:51.224(0)? ====== BEGIN MAIL #0 ====== 
I20140116-19:51:51.844(0)? MIME-Version: 1.0 
I20140116-19:51:51.844(0)? From: "Meteor Accounts" <[email protected]> 
I20140116-19:51:51.844(0)? To: [email protected] 
I20140116-19:51:51.845(0)? Subject: How to reset your password on localhost:3000 
I20140116-19:51:51.845(0)? Content-Type: text/plain; charset=utf-8 
I20140116-19:51:51.845(0)? Content-Transfer-Encoding: quoted-printable 
I20140116-19:51:51.846(0)? Hello, 
I20140116-19:51:51.846(0)? To reset your password, simply click the link below. 
I20140116-19:51:51.846(0)? http://localhost:3000/reset-password/vJTAFEfdnqMsRSRyf 
I20140116-19:51:51.846(0)? Thanks. 
I20140116-19:51:51.847(0)? ====== END MAIL #0 ====== 

謝謝!

+0

是電子郵件顯示了控制檯上? – Tobold

+0

Nop,控制檯不顯示任何東西 – swayziak

+0

我編輯了問題與服務器控制檯打印 – swayziak

回答

2
+0

謝謝,這是有幫助的。因此,將此代碼插入到終端「export MAIL_URL = smtp:// USERNAME:PASSWORD @ HOST:PORT /'」就足夠了?如何將[email protected]更改爲另一個電子郵件地址? – swayziak

+2

是的,只需導出MAIL_URL。此外,閱讀此http://docs.meteor.com/#accounts_emailtemplates更改電子郵件參數 – FredericoC

+0

建議的鏈接不能解決問題,所以我認爲你可以原諒downvote –