This commit is contained in:
fred 2023-12-31 13:39:42 +01:00
parent 1fc4f783bf
commit 5d4a405020
1 changed files with 13 additions and 9 deletions

View File

@ -23,14 +23,16 @@ mail="$1" # EMAIL DESTINATAIRE
pseudo=$(echo $mail | cut -d '@' -f 1) pseudo=$(echo $mail | cut -d '@' -f 1)
messfile="$2" # FICHIER A AJOUTER AU CORPS MESSAGE messfile="$2" # FICHIER A AJOUTER AU CORPS MESSAGEUP
SUBJECT="[UPlanet/Astroport] $pseudo : $(myHostName)" SUBJECT="[UPlanet/Astroport] $pseudo : $(myHostName)"
MESSAGE="Bonjour $PLAYER MESSAGEUP="MESSAGE
UN MESSAGE POUR VOUS. ===
"
Astroport MESSAGESIGN="---
/ipns/$IPFSNODEID Astroport $(myHostName)
$(myIpfsGw)/ipns/$IPFSNODEID
" "
echo " echo "
@ -43,7 +45,7 @@ echo "
#~ To: EMAIL #~ To: EMAIL
#~ Bcc: support@qo-op.com #~ Bcc: support@qo-op.com
#~ Subject: SUBJECT #~ Subject: SUBJECT
#~ $MESSAGE #~ $MESSAGEUP
#~ " > ~/.zen/tmp/email.txt #~ " > ~/.zen/tmp/email.txt
#~ [[ -s $messfile ]] && cat $messfile >> ~/.zen/tmp/email.txt \ #~ [[ -s $messfile ]] && cat $messfile >> ~/.zen/tmp/email.txt \
@ -58,20 +60,22 @@ export MJ_APIKEY_PRIVATE='58256ba8ea62f68965879f53bbb29f90'
export SENDER_EMAIL='support@g1sms.fr' export SENDER_EMAIL='support@g1sms.fr'
export RECIPIENT_EMAIL=${mail} export RECIPIENT_EMAIL=${mail}
# MESSAGE HEADER # MESSAGEUP HEADER
echo "$MESSAGE" > ~/.zen/tmp/email.txt echo "$MESSAGEUP" > ~/.zen/tmp/email.txt
# + HTML in FILE # + HTML in FILE
[[ -s $messfile ]] && cat $messfile >> ~/.zen/tmp/email.txt \ [[ -s $messfile ]] && cat $messfile >> ~/.zen/tmp/email.txt \
|| echo "$messfile" >> ~/.zen/tmp/email.txt || echo "$messfile" >> ~/.zen/tmp/email.txt
echo $MESSAGESIGN >> ~/.zen/tmp/email.txt
EMAILZ=$(ipfs add -q ~/.zen/tmp/email.txt) EMAILZ=$(ipfs add -q ~/.zen/tmp/email.txt)
echo "/ipfs/${EMAILZ}" echo "/ipfs/${EMAILZ}"
TEXTPART=$(cat ~/.zen/tmp/email.txt | sed ':a;N;$!ba;s/\n/\\n/g' | tr '"' '\\\"') TEXTPART=$(cat ~/.zen/tmp/email.txt | sed ':a;N;$!ba;s/\n/\\n/g' | tr '"' '\\\"')
HTMLPART=$(cat ~/.zen/tmp/email.txt | sed ':a;N;$!ba;s/\n/<br>/g' | tr '"' '\\\"') HTMLPART=$(cat ~/.zen/tmp/email.txt | sed ':a;N;$!ba;s/\n/<br>/g' | tr '"' '\\\"')
export TEXTPART="${myIPFS}/ipfs/${EMAILZ}" export TEXTPART="$(myIpfsGw)/ipfs/${EMAILZ}"
json_payload='{ json_payload='{
"Messages": [ "Messages": [