1, invited:
Hello XX! Thank you very much for your approval and notice (invitation). Thank you for giving me this opportunity to improve myself. I will attend the interview on time and look forward to meeting you!
Thanks again!
2. Reject:
Hello XX! Thank you very much for your recognition and notice (invitation), and thank you for providing me with this opportunity to improve myself. Because XX (the reason for rejection can simply explain your job intention or other reasons that affect your interview failure), I'm sorry.
Best wishes to Shang Qi!