Skip to content

UOperatingSystemMailManager

#include <OperatingSystemSimulator/Public/Data/OperatingSystemMailManager.h>
class UOperatingSystemMailManager

Defined in OperatingSystemMailManager.h:53

Inherits: USaveGame

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemMailManager["UOperatingSystemMailManager"]
  class USaveGame["USaveGame"]
  USaveGame <|-- UOperatingSystemMailManager
---
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
  }

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

ReturnNameDescription
voidK2_OnEmailRegisteredEvent handler that is called when an email account is registered.
voidK2_OnEmailSentEvent handler for when an email is sent.
voidK2_OnEmailFailedToDeliverNotifies when an email fails to deliver.

void K2_OnEmailRegistered(const FOperatingSystemEmail & EmailAccount)

Defined in OperatingSystemMailManager.h:245 Event handler that is called when an email account is registered.

  • EmailAccount The email account that was registered.

  • EmailAccount.Username: The username of the email account.

  • EmailAccount.Password: The password of the email account.

See also: FOperatingSystemEmail


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.

  • FromUser The user who sent the email.

  • ToUser The user who received the email.

  • MailData The data of the email that was sent.


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.

  • FromUser The user who sent the email.

  • ToUser The user who was supposed to receive the email.

  • MailData The email data that failed to deliver.

ReturnNameDescription
voidCreateMailSingleton staticCreates a singleton instance of the mail manager.
voidClearMailSingleton staticClears the mail singleton object by resetting it to null. It also saves any changes made before resetting the object.
FOperatingSystemMailSettingMakeMailSetting staticCreates a mail setting object with the given parameters.
voidRegisterNewMailAccount staticRegisters a new account for the given user. To check if success, check OutErrorIfAny::IsValid is false.
voidSendEmailToUser staticSends a mail from one user to another.
voidSendEmail staticBulk sends an email from given address to other addresses.
voidSendEmailFromDataTable staticSends all emails from the datatable (must use FOperatingSystemMailSetting datatable) to given email address. Typically used for sending developer predefined emails when creating new accounts.
voidGetEmailsForUser staticGets all the emails (or by category) from the given user.
voidTrashEmail staticDeletes 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).
voidArchiveEmail staticArchives an email for the given user.
voidChangeEmailState staticMarks the read/unread state of the given email.
voidRestoreMailToInbox staticChanges the category tag of the given email to inbox.
voidReplyToEmail staticReplies to a given email from the given user.
voidGetRepliesForEmail staticRetrieves a list of reply mails (if any) for the given email.
boolContainsReplies staticChecks if the given email has received any replies.
voidInternal_SendEmailToUser static

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

  • Get
  • OS_LOG
  • OS_LOG_ERROR
  • OS_LOG_VERBOSE
  • OS_LOG_VERY_VERBOSE

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.


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.

  • SenderName The name of the sender of the mail.

  • Subject The subject of the mail.

  • Content The content of the mail.

  • ContentWidgetClass The class pointer of the content widget for the mail.

  • SenderIcon The icon of the sender of the mail.

  • CategoryTag The category tag of the mail.

The created mail setting object.


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.

  • WorldContextObject World Context Object

  • ForUser Target user to create email for.

  • OutErrorIfAny Outputs error that happened (If there are any). This will always output to log.


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.

  • OutErrorIfAny Outputs error (if any). This will always be printed in Output Log.

  • WorldContextObject World Context Object.

  • FromUser The user that is sending the mail.

  • ToUser The user that is receiving the mail.

  • Mail Mail Content.


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.

  • OutErrorsIfAny Array of errors (if any). These will always be printed in Output Log.

  • WorldContextObject World Context Object.

  • FromEmailAddress Email address that is sending the mail.

  • ToEmailAddresses List of Email addresses that is receiving the mail.

  • Mail Mail Content.


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.

  • OutErrorIfAny Outputs error (if any). This will always be printed in Output Log.

  • WorldContextObject World Context Object.

  • ToEmailAddress Target email address to send.

  • EmailDataTable Email datatable to retrieve mails from and send.


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.

  • TargetUser User to retrieve email for.

  • OutEmails Array of emails found for the given user.

  • OptionalTag Optional category tag to filter emails. If None, invalid or incorrect, all emails will be fetched.

  • ReturnType Optional type to return.


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).

  • TargetUser Logged in user to delete email for.

  • TargetEmail Email 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).


static

static void ArchiveEmail(const FOperatingSystemUser & TargetUser, FOperatingSystemMailSetting & TargetEmail)

Defined in OperatingSystemMailManager.h:182 Archives an email for the given user.

  • TargetUser Logged in user to archive mail for.

  • TargetEmail Email that needs to be archived.


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.

  • TargetUser Logged in user.

  • TargetEmail Email that need to changes its read state.

  • bMarkAsRead Whether to mark the mail as read or unread.


static

static void RestoreMailToInbox(const FOperatingSystemUser & TargetUser, FOperatingSystemMailSetting & TargetEmail)

Defined in OperatingSystemMailManager.h:199 Changes the category tag of the given email to inbox.

  • TargetUser Logged in user.

  • TargetEmail Email that will be moving to inbox.


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.

  • WorldContextObject World Context Object

  • FromUser Logged in user.

  • TargetEmail Email that is sending the reply.

  • ReplyEmail Reply Email content.

  • OutError Contains error (if any).


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.

  • TargetEmail Email to check replies for.

  • OutEmails Array of replies for the given email.


static

static bool ContainsReplies(const FOperatingSystemMailSetting & TargetEmail)

Defined in OperatingSystemMailManager.h:228 Checks if the given email has received any replies.

  • TargetEmail Email to check for replies.

True if the given email has any replies.


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