You can change the here-doc operator to <<-. You can then indent both the here-doc and the delimiter with tabs:
#! /bin/bash
cat <<-EOF
indented
EOF
echo Done
If you don't need command substitution and parameter expansion inside your here-document, you can avoid using tabs by adding the leading spaces to the delimiter:
$ cat << ' EOF'
> indented
> EOF
indented
$ cat << ' EOF' | sed -r 's/^ {8}//'
> unindented
> EOF
unindented
mail_content="Last Change: $dateLastChanged
This is an automated warning of stale data for the UNC-G Blackboard Snapshot process."
mailx -r "Systems and Operations <sysadmin@[redacted].edu>" -s "Warning Stale BB Data" jadavis6@[redacted].edu <<<"$mail_content"
usage () {
# No tabs necessary!
readarray message <<' EOF'
Hello, this is a cool program.
This should get unindented.
This code should stay indented:
something() {
echo It works, yo!;
}
That's all.
EOF
# Each line is indented an extra 8 spaces, so strip them
printf '%s' "${message[@]# }"
}
sed 's/^ *//' >> ~/Desktop/text.txt << EOF
Load time-out reached and nothing to resume.
$(date +%T) - Transmission-daemon exiting.
EOF