Thread Tools Display Modes
06/10/14, 01:57 PM   #1
Sternentau
board director
 
Sternentau's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 17
SendMail prerequisites?

is the SendMail function functionable for addONs?
I was not able to send mail

"SendMail(string to, string subject, string body)"

nothing happened, neither the message was sent nor an error...
  Reply With Quote
06/10/14, 02:39 PM   #2
pills
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 11
Not 100% sure but try issuing the command while you have the send mail scene visible (e.g. Open your mail inbox then select the send mail tab)

I use sendmail() but it doesn't seem to work if scene is not active
  Reply With Quote
06/10/14, 02:56 PM   #3
Sternentau
board director
 
Sternentau's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 17
Originally Posted by pills View Post
Not 100% sure but try issuing the command while you have the send mail scene visible (e.g. Open your mail inbox then select the send mail tab)

I use sendmail() but it doesn't seem to work if scene is not active

That worked. Thanks a lot.
Now i have to deal how to open and to close the mail scene
  Reply With Quote
06/10/14, 03:33 PM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Sternentau View Post
That worked. Thanks a lot.
Now i have to deal how to open and to close the mail scene
Lua Code:
  1. SCENE_MANAGER:Show("mailInbox")
  2. SCENE_MANAGER:Hide("mailInbox")
  3. SCENE_MANAGER:Toggle("mailInbox")
  4.  
  5. SCENE_MANAGER:Show("mailSend")
  6. SCENE_MANAGER:Hide("mailSend")
  7. SCENE_MANAGER:Toggle("mailSend")
  8.  
  9. --or instead of hiding current scene, show base scene (that's what "Exit" button on keybind strip does):
  10. SCENE_MANAGER:ShowBaseScene()

Last edited by Garkin : 06/10/14 at 05:05 PM.
  Reply With Quote
11/14/14, 04:28 AM   #5
Sir Tigär
Join Date: Jul 2014
Posts: 9
Hello mates.

I tried something out like this:

--------------------------------------------
SLASH_COMMANDS["/mail"] = function()
SCENE_MANAGER:Show("mailSend")
SendMail("@xyz","abc","abc")
SCENE_MANAGER:Hide("mailSend")
end
--------------------------------------------

If i write "/mail" in chat, i send an automatic mail and the mail-screen disappears after all.
The focus on screen is existing ( i can move around with camera ), but the cross in the middle of the screen has no function unfortunately. Except i press "W,A,S,D,Mouseclick".
Is there a possibility getting automatically focus back on screen/cross?

I hope it is understandable enough

regards
Marcel
  Reply With Quote
11/14/14, 04:44 AM   #6
manavortex
 
manavortex's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 138
If you hide the scene, you're basically still in the mail scene, it's just hidden. I think you'd need to close it instead of hiding it, to give control back to the basic game?
  Reply With Quote
11/14/14, 04:57 AM   #7
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
edit: err... answering a different question :/

You could try:
Lua Code:
  1. SCENE_MANAGER:Push("mailSend")
  2. ...
  3. SCENE_MANAGER:PopScenes(1)

Last edited by merlight : 11/14/14 at 05:11 AM.
  Reply With Quote
11/14/14, 05:55 AM   #8
Sir Tigär
Join Date: Jul 2014
Posts: 9
Originally Posted by merlight View Post
edit: err... answering a different question :/

You could try:
Lua Code:
  1. SCENE_MANAGER:Push("mailSend")
  2. ...
  3. SCENE_MANAGER:PopScenes(1)
First thanks for the reply!
I tried it out, but that didnt work :/


regards Marcel
  Reply With Quote
11/14/14, 06:32 AM   #9
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Ok I tried another way, basically what I used in an add-on that just opened mailSend and pre-filled the fields; adding return to previous scene:

Lua Code:
  1. local returnScene = SCENE_MANAGER:GetCurrentScene():GetName()
  2. SCENE_MANAGER:Show("mailSend")
  3. SCENE_MANAGER:CallWhen("mailSend", SCENE_SHOWN, function()
  4.     d("shown " .. SCENE_MANAGER:GetCurrentScene():GetName())
  5.     d("going back to " .. returnScene)
  6.     if returnScene then
  7.         SCENE_MANAGER:Show(returnScene)
  8.     else
  9.         SCENE_MANAGER:Hide("mailSend")
  10.     end
  11. end)

Works for me. The issue you described looks like a bug I've been experiencing since launch. Often after playing for some time, whenever I close the map, mouse-turning doesn't work, I have to click. The only solution I've found so far is /reloadui

edit: oh, I've just noticed the thing above itself works, but somehow breaks my inbox, I can't read the first mail in the list :/ /reloadui doesn't help

Last edited by merlight : 11/14/14 at 06:39 AM.
  Reply With Quote
11/15/14, 04:31 AM   #10
Sir Tigär
Join Date: Jul 2014
Posts: 9
Originally Posted by merlight View Post
Ok I tried another way, basically what I used in an add-on that just opened mailSend and pre-filled the fields; adding return to previous scene:

Lua Code:
  1. local returnScene = SCENE_MANAGER:GetCurrentScene():GetName()
  2. SCENE_MANAGER:Show("mailSend")
  3. SCENE_MANAGER:CallWhen("mailSend", SCENE_SHOWN, function()
  4.     d("shown " .. SCENE_MANAGER:GetCurrentScene():GetName())
  5.     d("going back to " .. returnScene)
  6.     if returnScene then
  7.         SCENE_MANAGER:Show(returnScene)
  8.     else
  9.         SCENE_MANAGER:Hide("mailSend")
  10.     end
  11. end)

Works for me. The issue you described looks like a bug I've been experiencing since launch. Often after playing for some time, whenever I close the map, mouse-turning doesn't work, I have to click. The only solution I've found so far is /reloadui

edit: oh, I've just noticed the thing above itself works, but somehow breaks my inbox, I can't read the first mail in the list :/ /reloadui doesn't help
Same Problem as before, i lose the focus on cross :/
Look for another approach.
Thx all.
regards
Marcel
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » SendMail prerequisites?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off