应用程序创建了课堂邀请,但没有电子邮件发送给学生

时间:2018-12-11 03:03:48

标签: google-api-client google-classroom

创建教室邀请后,方法教室.create返回返回状态为200,但用户从未收到带有邀请消息的电子邮件。

我给了与我正在使用的服务帐户相关联的客户ID,范围为school.roster和mail.google.com,但似乎没有任何作用。 我想念什么吗?

非常感谢你, 安德烈斯 这是创建邀请的代码片段:

//get authorization client

const auth = await google.auth.getClient({
    scopes
  });
//impersonate teacher account
  if (auth instanceof google.auth.JWT) {
    auth.subject = 'teacher_email@dom.edu';
    }


 const options = {    auth,     
                                requestBody: {
                                courseId: '19220887720',
                                role: 'STUDENT',
                                userId: 'student_email@dom.edu'
                                  }
  };
//send invitation
try {
    const invitation = await classroom.invitations.create(options);
    console.log('invitation was sent:', invitation);
  } catch (err) {
    console.error('error: ' , err);
  }

响应:状态为200。

邀请已真正创建。响应中包含邀请ID,如果您查看ClassRoom主页->人物,则可以看到邀请了正确的学生。

1 个答案:

答案 0 :(得分:0)

基于此forum,学生需要在帐户中进行相同的设置,而默认情况下可能不需要。他们还应该选择首先成为一名学生。

此外,Google课堂的通知电子邮件是从classroom.google.com域发送的。有关更多详细信息,请参见Email notifications - Classroom Help

相关问题