UOperatingSystemMailManager
#include <OperatingSystemSimulator/Public/Data/OperatingSystemMailManager.h>class UOperatingSystemMailManagerDefined in OperatingSystemMailManager.h:53
Inherits:
USaveGame
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemMailManager["UOperatingSystemMailManager"]
class USaveGame["USaveGame"]
USaveGame <|-- UOperatingSystemMailManager
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemMailManager {
+K2_OnEmailRegistered(const FOperatingSystemEmail &EmailAccount)
+K2_OnEmailSent(const FOperatingSystemUser &FromUser, const
+K2_OnEmailFailedToDeliver(const FOperatingSystemUser &FromUser, const
+CreateMailSingleton()
+ClearMailSingleton()
+MakeMailSetting(const FText SenderName, const FText Subject FOperatingSystemMailSetting()
+RegisterNewMailAccount(const UObject *WorldContextObject, const FO
+SendEmailToUser(FGenericError &OutErrorIfAny, const UObject
+SendEmail(TArray< FGenericError > &OutErrorsIfAny, co
+SendEmailFromDataTable(FGenericError &OutErrorIfAny, const UObject
+GetEmailsForUser(const FOperatingSystemUser &TargetUser, TAr
+TrashEmail(const FOperatingSystemUser &TargetUser, FOp
+ArchiveEmail(const FOperatingSystemUser &TargetUser, FOp
+ChangeEmailState(const FOperatingSystemUser &TargetUser, FOp
+RestoreMailToInbox(const FOperatingSystemUser &TargetUser, FOp
+ReplyToEmail(const UObject *WorldContextObject, const FO
+GetRepliesForEmail(const FOperatingSystemMailSetting &TargetEm
+ContainsReplies(const FOperatingSystemMailSetting &TargetEm bool
+Internal_SendEmailToUser(FGenericError &OutErrorIfAny, const UObject
}
Caller impact — Save
Section titled “Caller impact — Save”Documented call sites inside the plugin (10):
flowchart LR UOperatingSystemMailManager__Save["UOperatingSystemMailManager::Save"] UOperatingSystemMailManager__ArchiveEmail["UOperatingSystemMailManager::ArchiveEmail"] UOperatingSystemMailManager__ArchiveEmail --> UOperatingSystemMailManager__Save UOperatingSystemMailManager__ChangeEmailState["UOperatingSystemMailManager::ChangeEmailState"] UOperatingSystemMailManager__ChangeEmailState --> UOperatingSystemMailManager__Save UOperatingSystemMailManager__ClearMailSingleton["UOperatingSystemMailManager::ClearMailSingleton"] UOperatingSystemMailManager__ClearMailSingleton --> UOperatingSystemMailManager__Save UOperatingSystemMailManager__Internal_SendEmailToUser["UOperatingSystemMailManager::Internal_SendEmailToUser"] UOperatingSystemMailManager__Internal_SendEmailToUser --> UOperatingSystemMailManager__Save UOperatingSystemMailManager__RegisterNewMailAccount["UOperatingSystemMailManager::RegisterNewMailAccount"] UOperatingSystemMailManager__RegisterNewMailAccount --> UOperatingSystemMailManager__Save UOperatingSystemMailManager__ReplyToEmail["UOperatingSystemMailManager::ReplyToEmail"] UOperatingSystemMailManager__ReplyToEmail --> UOperatingSystemMailManager__Save UOperatingSystemMailManager__RestoreMailToInbox["UOperatingSystemMailManager::RestoreMailToInbox"] UOperatingSystemMailManager__RestoreMailToInbox --> UOperatingSystemMailManager__Save UOperatingSystemMailManager__SendEmail["UOperatingSystemMailManager::SendEmail"] UOperatingSystemMailManager__SendEmail --> UOperatingSystemMailManager__Save UOperatingSystemMailManager__SendEmailFromDataTable["UOperatingSystemMailManager::SendEmailFromDataTable"] UOperatingSystemMailManager__SendEmailFromDataTable --> UOperatingSystemMailManager__Save UOperatingSystemMailManager__TrashEmail["UOperatingSystemMailManager::TrashEmail"] UOperatingSystemMailManager__TrashEmail --> UOperatingSystemMailManager__Save
Caller impact — Internal_SendEmailToUser
Section titled “Caller impact — Internal_SendEmailToUser”Documented call sites inside the plugin (3):
flowchart LR UOperatingSystemMailManager__Internal_SendEmailToUser["UOperatingSystemMailManager::Internal_SendEmailToUser"] UOperatingSystemMailManager__SendEmail["UOperatingSystemMailManager::SendEmail"] UOperatingSystemMailManager__SendEmail --> UOperatingSystemMailManager__Internal_SendEmailToUser UOperatingSystemMailManager__SendEmailFromDataTable["UOperatingSystemMailManager::SendEmailFromDataTable"] UOperatingSystemMailManager__SendEmailFromDataTable --> UOperatingSystemMailManager__Internal_SendEmailToUser UOperatingSystemMailManager__SendEmailToUser["UOperatingSystemMailManager::SendEmailToUser"] UOperatingSystemMailManager__SendEmailToUser --> UOperatingSystemMailManager__Internal_SendEmailToUser
Handles the management of operating system emails.
It provides functionality to create and register new mail accounts, send emails between users, and perform various operations on emails such as deleting, archiving, marking as read
Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
void | K2_OnEmailRegistered | Event handler that is called when an email account is registered. |
void | K2_OnEmailSent | Event handler for when an email is sent. |
void | K2_OnEmailFailedToDeliver | Notifies when an email fails to deliver. |
K2_OnEmailRegistered
Section titled “K2_OnEmailRegistered”void K2_OnEmailRegistered(const FOperatingSystemEmail & EmailAccount)Defined in OperatingSystemMailManager.h:245 Event handler that is called when an email account is registered.
Parameters
Section titled “Parameters”-
EmailAccountThe email account that was registered. -
EmailAccount.Username: The username of the email account.
-
EmailAccount.Password: The password of the email account.
See also: FOperatingSystemEmail
K2_OnEmailSent
Section titled “K2_OnEmailSent”void K2_OnEmailSent(const FOperatingSystemUser & FromUser, const FOperatingSystemUser & ToUser, const FOperatingSystemMailSetting & MailData)Defined in OperatingSystemMailManager.h:257 Event handler for when an email is sent.
This event is triggered when an email is sent from one user to another.
Parameters
Section titled “Parameters”-
FromUserThe user who sent the email. -
ToUserThe user who received the email. -
MailDataThe data of the email that was sent.
K2_OnEmailFailedToDeliver
Section titled “K2_OnEmailFailedToDeliver”void K2_OnEmailFailedToDeliver(const FOperatingSystemUser & FromUser, const FOperatingSystemUser & ToUser, const FOperatingSystemMailSetting & MailData)Defined in OperatingSystemMailManager.h:270 Notifies when an email fails to deliver.
This method is an event that is triggered when an email fails to deliver. It provides information about the sender, recipient, and the email settings.
Parameters
Section titled “Parameters”-
FromUserThe user who sent the email. -
ToUserThe user who was supposed to receive the email. -
MailDataThe email data that failed to deliver.
Private Static Methods
Section titled “Private Static Methods”| Return | Name | Description |
|---|---|---|
void | CreateMailSingleton static | Creates a singleton instance of the mail manager. |
void | ClearMailSingleton static | Clears the mail singleton object by resetting it to null. It also saves any changes made before resetting the object. |
FOperatingSystemMailSetting | MakeMailSetting static | Creates a mail setting object with the given parameters. |
void | RegisterNewMailAccount static | Registers a new account for the given user. To check if success, check OutErrorIfAny::IsValid is false. |
void | SendEmailToUser static | Sends a mail from one user to another. |
void | SendEmail static | Bulk sends an email from given address to other addresses. |
void | SendEmailFromDataTable static | Sends all emails from the datatable (must use FOperatingSystemMailSetting datatable) to given email address. Typically used for sending developer predefined emails when creating new accounts. |
void | GetEmailsForUser static | Gets all the emails (or by category) from the given user. |
void | TrashEmail static | Deletes a message for the given user. If the email is in trash (a.k.a bin) it will be removed permanently. Anywhere else it will be moved to trash (a.k.a bin). |
void | ArchiveEmail static | Archives an email for the given user. |
void | ChangeEmailState static | Marks the read/unread state of the given email. |
void | RestoreMailToInbox static | Changes the category tag of the given email to inbox. |
void | ReplyToEmail static | Replies to a given email from the given user. |
void | GetRepliesForEmail static | Retrieves a list of reply mails (if any) for the given email. |
bool | ContainsReplies static | Checks if the given email has received any replies. |
void | Internal_SendEmailToUser static |
CreateMailSingleton
Section titled “CreateMailSingleton”static
static void CreateMailSingleton()Defined in OperatingSystemMailManager.h:87 Creates a singleton instance of the mail manager.
This method is responsible for creating a singleton instance of the mail manager. If the instance already exists, this method does nothing.
See also: UOperatingSystemPluginSettings::MailClass
See also: UOperatingSystemMailManager::MailSingleton
Referenced by
Section titled “Referenced by”References
Section titled “References”GetOS_LOGOS_LOG_ERROROS_LOG_VERBOSEOS_LOG_VERY_VERBOSE
ClearMailSingleton
Section titled “ClearMailSingleton”static
static void ClearMailSingleton()Defined in OperatingSystemMailManager.h:93 Clears the mail singleton object by resetting it to null. It also saves any changes made before resetting the object.
Referenced by
Section titled “Referenced by”References
Section titled “References”MakeMailSetting
Section titled “MakeMailSetting”static
static FOperatingSystemMailSetting MakeMailSetting(const FText SenderName, const FText Subject, const FText Content, const TSoftClassPtr< UOperatingSystemMailContentWidget > ContentWidgetClass, const TSoftObjectPtr< UObject > SenderIcon, const FGameplayTag CategoryTag)Defined in OperatingSystemMailManager.h:108 Creates a mail setting object with the given parameters.
Parameters
Section titled “Parameters”-
SenderNameThe name of the sender of the mail. -
SubjectThe subject of the mail. -
ContentThe content of the mail. -
ContentWidgetClassThe class pointer of the content widget for the mail. -
SenderIconThe icon of the sender of the mail. -
CategoryTagThe category tag of the mail.
Returns
Section titled “Returns”The created mail setting object.
References
Section titled “References”RegisterNewMailAccount
Section titled “RegisterNewMailAccount”static
static void RegisterNewMailAccount(const UObject * WorldContextObject, const FOperatingSystemUser & ForUser, FGenericError & OutErrorIfAny)Defined in OperatingSystemMailManager.h:120 Registers a new account for the given user. To check if success, check OutErrorIfAny::IsValid is false.
Parameters
Section titled “Parameters”-
WorldContextObjectWorld Context Object -
ForUserTarget user to create email for. -
OutErrorIfAnyOutputs error that happened (If there are any). This will always output to log.
References
Section titled “References”EmailErrorExceptionDescriptionGetGetUserManagerIsCompleteProfileIsValidMAKE_ERROROS_LOGOS_LOG_ERROROS_LOG_VERY_VERBOSEPasswordResetSaveUsername
SendEmailToUser
Section titled “SendEmailToUser”static
static void SendEmailToUser(FGenericError & OutErrorIfAny, const UObject * WorldContextObject, const FOperatingSystemUser & FromUser, const FOperatingSystemUser & ToUser, const FOperatingSystemMailSetting & Mail)Defined in OperatingSystemMailManager.h:131 Sends a mail from one user to another.
Parameters
Section titled “Parameters”-
OutErrorIfAnyOutputs error (if any). This will always be printed in Output Log. -
WorldContextObjectWorld Context Object. -
FromUserThe user that is sending the mail. -
ToUserThe user that is receiving the mail. -
MailMail Content.
References
Section titled “References”SendEmail
Section titled “SendEmail”static
static void SendEmail(TArray< FGenericError > & OutErrorsIfAny, const UObject * WorldContextObject, const FText & FromEmailAddress, const TArray< FText > & ToEmailAddresses, const FOperatingSystemMailSetting & Mail)Defined in OperatingSystemMailManager.h:142 Bulk sends an email from given address to other addresses.
Parameters
Section titled “Parameters”-
OutErrorsIfAnyArray of errors (if any). These will always be printed in Output Log. -
WorldContextObjectWorld Context Object. -
FromEmailAddressEmail address that is sending the mail. -
ToEmailAddressesList of Email addresses that is receiving the mail. -
MailMail Content.
References
Section titled “References”GetUserManagerInternal_SendEmailToUserIsValidMAKE_ERROROS_LOG_ERRORSave
SendEmailFromDataTable
Section titled “SendEmailFromDataTable”static
static void SendEmailFromDataTable(FGenericError & OutErrorIfAny, const UObject * WorldContextObject, const FText & ToEmailAddress, const TSoftObjectPtr< UDataTable > EmailDataTable)Defined in OperatingSystemMailManager.h:153 Sends all emails from the datatable (must use FOperatingSystemMailSetting datatable) to given email address. Typically used for sending developer predefined emails when creating new accounts.
Parameters
Section titled “Parameters”-
OutErrorIfAnyOutputs error (if any). This will always be printed in Output Log. -
WorldContextObjectWorld Context Object. -
ToEmailAddressTarget email address to send. -
EmailDataTableEmail datatable to retrieve mails from and send.
References
Section titled “References”ErrorExceptionDescriptionGetGetUserManagerInternal_SendEmailToUserIsCompleteProfileIsValidMAKE_ERROROS_LOG_ERRORResetSave
GetEmailsForUser
Section titled “GetEmailsForUser”static
static void GetEmailsForUser(const FOperatingSystemUser & TargetUser, TArray< FOperatingSystemMailSetting > & OutEmails, const FGameplayTag OptionalTag, const EOperatingSystemMailReturnType ReturnType = EOperatingSystemMailReturnType::All)Defined in OperatingSystemMailManager.h:163 Gets all the emails (or by category) from the given user.
Parameters
Section titled “Parameters”-
TargetUserUser to retrieve email for. -
OutEmailsArray of emails found for the given user. -
OptionalTagOptional category tag to filter emails. If None, invalid or incorrect, all emails will be fetched. -
ReturnTypeOptional type to return.
References
Section titled “References”IsValidCategoryTagReadOnlyUnreadOnly
TrashEmail
Section titled “TrashEmail”static
static void TrashEmail(const FOperatingSystemUser & TargetUser, FOperatingSystemMailSetting & TargetEmail)Defined in OperatingSystemMailManager.h:174 Deletes a message for the given user. If the email is in trash (a.k.a bin) it will be removed permanently. Anywhere else it will be moved to trash (a.k.a bin).
Parameters
Section titled “Parameters”-
TargetUserLogged in user to delete email for. -
TargetEmailEmail that needs to be deleted. If the email is in trash (a.k.a bin) it will removed permanently. For anything else it will be moved to trash (a.k.a bin).
References
Section titled “References”CategoryTagIsValidOS_LOG_VERBOSESave
ArchiveEmail
Section titled “ArchiveEmail”static
static void ArchiveEmail(const FOperatingSystemUser & TargetUser, FOperatingSystemMailSetting & TargetEmail)Defined in OperatingSystemMailManager.h:182 Archives an email for the given user.
Parameters
Section titled “Parameters”-
TargetUserLogged in user to archive mail for. -
TargetEmailEmail that needs to be archived.
References
Section titled “References”CategoryTagIsValidOS_LOG_VERBOSESave
ChangeEmailState
Section titled “ChangeEmailState”static
static void ChangeEmailState(const FOperatingSystemUser & TargetUser, FOperatingSystemMailSetting & TargetEmail, const bool bMarkAsRead)Defined in OperatingSystemMailManager.h:191 Marks the read/unread state of the given email.
Parameters
Section titled “Parameters”-
TargetUserLogged in user. -
TargetEmailEmail that need to changes its read state. -
bMarkAsReadWhether to mark the mail as read or unread.
References
Section titled “References”RestoreMailToInbox
Section titled “RestoreMailToInbox”static
static void RestoreMailToInbox(const FOperatingSystemUser & TargetUser, FOperatingSystemMailSetting & TargetEmail)Defined in OperatingSystemMailManager.h:199 Changes the category tag of the given email to inbox.
Parameters
Section titled “Parameters”-
TargetUserLogged in user. -
TargetEmailEmail that will be moving to inbox.
References
Section titled “References”ReplyToEmail
Section titled “ReplyToEmail”static
static void ReplyToEmail(const UObject * WorldContextObject, const FOperatingSystemUser & FromUser, const FOperatingSystemMailSetting & TargetEmail, FOperatingSystemMailSetting & ReplyEmail, FGenericError & OutError)Defined in OperatingSystemMailManager.h:210 Replies to a given email from the given user.
Parameters
Section titled “Parameters”-
WorldContextObjectWorld Context Object -
FromUserLogged in user. -
TargetEmailEmail that is sending the reply. -
ReplyEmailReply Email content. -
OutErrorContains error (if any).
References
Section titled “References”AuthorEmailbIsReplybIsUnreadCanReceiveEmailsEmailErrorExceptionDescriptionFromEmailGetUserManagerIsCompleteProfileIsValidIsValidLastReplyDateMAKE_ERROROS_LOG_ERROROS_LOG_VERY_VERBOSEResetSaveToEmailUsername
GetRepliesForEmail
Section titled “GetRepliesForEmail”static
static void GetRepliesForEmail(const FOperatingSystemMailSetting & TargetEmail, TArray< FOperatingSystemMailSetting > & OutEmails)Defined in OperatingSystemMailManager.h:220 Retrieves a list of reply mails (if any) for the given email.
Parameters
Section titled “Parameters”-
TargetEmailEmail to check replies for. -
OutEmailsArray of replies for the given email.
ContainsReplies
Section titled “ContainsReplies”static
static bool ContainsReplies(const FOperatingSystemMailSetting & TargetEmail)Defined in OperatingSystemMailManager.h:228 Checks if the given email has received any replies.
Parameters
Section titled “Parameters”TargetEmailEmail to check for replies.
Returns
Section titled “Returns”True if the given email has any replies.
Internal_SendEmailToUser
Section titled “Internal_SendEmailToUser”static
static void Internal_SendEmailToUser(FGenericError & OutErrorIfAny, const UObject * WorldContextObject, const FOperatingSystemUser & FromUser, const FOperatingSystemUser & ToUser, const FOperatingSystemMailSetting & Mail, const bool bSave)Defined in OperatingSystemMailManager.h:274
Referenced by
Section titled “Referenced by”References
Section titled “References”AuthorEmailCanReceiveEmailsCategoryTagEmailErrorExceptionDescriptionFromEmailIsCompleteProfileIsValidIsValidIsValidMAKE_ERROROS_LOGOS_LOG_ERROROS_LOG_VERY_VERBOSEResetSaveToEmailUsername