protected override void ShowMailShareComposer (MailShareComposer _composer)
		{
			base.ShowMailShareComposer(_composer);
			
			if (!IsMessagingServiceAvailable())
				return;

			if (_composer.AttachmentData != null)
				Console.LogWarning(Constants.kDebugTag, "[Sharing:Mail] Attachments are not supported in editor");

			string	_mailToAddress	= null;

			if (_composer.ToRecipients != null)
				_mailToAddress		= string.Join(",", _composer.ToRecipients);

			string	_mailToSubject	= EscapingString(_composer.Subject);
			string	_mailToBody		= EscapingString(_composer.Body);
			string	_mailToString	= string.Format("mailto:{0}?subject={1}&body={2}", _mailToAddress, _mailToSubject, _mailToBody);

			// Opens mail client
			Application.OpenURL(_mailToString);

			// Send event
			MailShareFinished(null);
		}
        protected override void ShowMailShareComposer(MailShareComposer _composer)
        {
            base.ShowMailShareComposer(_composer);

            if (!IsMailServiceAvailable())
            {
                return;
            }

            if (_composer.AttachmentData != null)
            {
                DebugUtility.Logger.LogWarning(Constants.kDebugTag, "[Sharing:Mail] Attachments are not supported in editor");
            }

            string _mailToAddress = null;

            if (_composer.ToRecipients != null)
            {
                _mailToAddress = string.Join(",", _composer.ToRecipients);
            }

            string _mailToSubject = EscapingString(_composer.Subject);
            string _mailToBody    = EscapingString(_composer.Body);
            string _mailToString  = string.Format("mailto:{0}?subject={1}&body={2}", _mailToAddress, _mailToSubject, _mailToBody);

            // Opens mail client
            Application.OpenURL(_mailToString);

            // Send event
            MailShareFinished(null);
        }
Exemplo n.º 3
0
 protected virtual void ShowMailShareComposer(MailShareComposer _composer)
 {
     if (!IsMailServiceAvailable())
     {
         MailShareFinished(MailShareFailedResponse());
         return;
     }
 }
		protected virtual void ShowMailShareComposer (MailShareComposer _composer)
		{
			if (!IsMailServiceAvailable())
			{
				MailShareFinished(MailShareFailedResponse());
				return;
			}
		}
		protected override void ShowMailShareComposer (MailShareComposer _composer)
		{
			base.ShowMailShareComposer(_composer);
			
			if (!IsMailServiceAvailable())
				return;
			
			// Native method call
			int 	_dataArrayLength		= (_composer.AttachmentData == null) ? 0 : _composer.AttachmentData.Length;
			string	_toRecipientsJSONList	= (_composer.ToRecipients == null) ? null : _composer.ToRecipients.ToJSON();
			string	_CCRecipientsJSONList	= (_composer.CCRecipients == null) ? null : _composer.CCRecipients.ToJSON();
			string	_BCCRecipientsJSONList	= (_composer.BCCRecipients == null) ? null : _composer.BCCRecipients.ToJSON();
			
			Plugin.Call(Native.Methods.SEND_MAIL, _composer.Subject, _composer.Body,
			            _composer.IsHTMLBody, _composer.AttachmentData, _dataArrayLength,
			            _composer.MimeType, _composer.AttachmentFileName, _toRecipientsJSONList, _CCRecipientsJSONList, _BCCRecipientsJSONList);
		}
Exemplo n.º 6
0
        protected override void ShowMailShareComposer(MailShareComposer _composer)
        {
            base.ShowMailShareComposer(_composer);

            if (!IsMailServiceAvailable())
            {
                return;
            }

            // Native method call
            int    _dataArrayLength       = (_composer.AttachmentData == null) ? 0 : _composer.AttachmentData.Length;
            string _toRecipientsJSONList  = (_composer.ToRecipients == null) ? null : _composer.ToRecipients.ToJSON();
            string _CCRecipientsJSONList  = (_composer.CCRecipients == null) ? null : _composer.CCRecipients.ToJSON();
            string _BCCRecipientsJSONList = (_composer.BCCRecipients == null) ? null : _composer.BCCRecipients.ToJSON();

            Plugin.Call(Native.Methods.SEND_MAIL, _composer.Subject, _composer.Body,
                        _composer.IsHTMLBody, _composer.AttachmentData, _dataArrayLength,
                        _composer.MimeType, _composer.AttachmentFileName, _toRecipientsJSONList, _CCRecipientsJSONList, _BCCRecipientsJSONList);
        }
		private void SendMailWithAttachment ()
		{
			// Create composer
			MailShareComposer	_composer	= new MailShareComposer();
			_composer.Subject				= m_mailSubject;
			_composer.Body					= m_plainMailBody;
			_composer.IsHTMLBody			= false;
			_composer.ToRecipients			= m_mailToRecipients;
			_composer.CCRecipients			= m_mailCCRecipients;
			_composer.BCCRecipients			= m_mailBCCRecipients;
			_composer.AddAttachmentAtPath(GetImageFullPath(), MIMEType.kPNG);
			
			// Show share view
			NPBinding.Sharing.ShowView(_composer, FinishedSharing);
		}
		private void SendMailWithScreenshot ()
		{
			// Create composer
			MailShareComposer	_composer	= new MailShareComposer();
			_composer.Subject				= m_mailSubject;
			_composer.Body					= m_plainMailBody;
			_composer.IsHTMLBody			= false;
			_composer.ToRecipients			= m_mailToRecipients;
			_composer.CCRecipients			= m_mailCCRecipients;
			_composer.BCCRecipients			= m_mailBCCRecipients;
			_composer.AttachScreenShot();
			
			// Show share view
			NPBinding.Sharing.ShowView(_composer, FinishedSharing);
		}
		private void SendHTMLTextMail () 
		{
			// Create composer
			MailShareComposer	_composer	= new MailShareComposer();
			_composer.Subject				= m_mailSubject;
			_composer.Body					= m_htmlMailBody;
			_composer.IsHTMLBody			= true;
			_composer.ToRecipients			= m_mailToRecipients;
			_composer.CCRecipients			= m_mailCCRecipients;
			_composer.BCCRecipients			= m_mailBCCRecipients;

			// Show share view
			NPBinding.Sharing.ShowView(_composer, FinishedSharing);
		}