Preparing a message in response to the event is easy and would look like that:
Lua Code:
local addonName = "WhatEverYouWantToCallIt"
local messageTemplate = "Welcome to <<1>>, <<2>>. Be sure to check out our MOTD by pressing G and clicking Home. If you have any questions, I'm sure someone would be happy to help you out!"
EVENT_MANAGER:RegisterForEvent(addonName, EVENT_GUILD_MEMBER_ADDED, function(_, guildId, displayName)
local message = zo_strformat(messageTemplate, GetGuildName(guildId), displayName)
StartChatInput(message)
end)
It will take a hardcoded message, fill in the guild name and displayname and then put it into the chat input field.
The hard part is to make it convenient. Right now it will simply overwrite whatever you have been typing whenever a member joins a guild. It also won't automatically switch to the chat channel of the guild. There are also no options to change the message ingame, and you cannot choose which guild it should generate the message for.